asp.net删除数据的时候,要弹出删除确认对话框,询问是否删除,这怎么做?
怎么加删除确认的代码??? protectedvoidButton2_Click(objectsender,EventArgse) &nb...
怎么加删除确认的代码??? protected void Button2_Click(object sender, EventArgs e) { SqlConnection con = new SqlConnection("Server=.\\SQLEXPRESS;uid=sa;pwd=59365615;Database=Attendance Manage"); con.Open(); string sqlstr7 = "drop table " + DropDownList1.SelectedValue; SqlCommand cmd = new SqlCommand(sqlstr7, con); cmd.ExecuteNonQuery(); Response.Write("<script>alert('删除成功!')</script>"); } winform里我知道是这样的: if (MessageBox.Show("是否要删除?", "删除确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes) {}
展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询