彈出窗口,確定再刪除數據
View Code
1 <head runat="server">
2 <title></title>
3 <script type="text/javascript">
4 function myClick() {
5 if (confirm("你確定要刪除嗎?")) {
6 return true;
7 }
8 else {
9 return false;
10 }
11 }
12
13 </script>
14 </head>
15
16
17
18 <body>
19 <form id="form1" runat="server">
20 <div>
21 <asp:Button ID="Button1" runat="server" OnClientClick="return myClick();" OnClick="Button1_Click"
22 Text="Button" />
23
24 </div>
25 </form>
26 </body>
View Code
1 後臺代碼
2 protected void Button1_Click(object sender, EventArgs e)
3 {
4 Button1.Text = "Hello World";
5 //在這裏寫刪除數據庫裏數據的代碼。
6 }
本文来自博客园,作者:追夢,转载请注明原文链接:https://www.cnblogs.com/koeltp/archive/2011/12/27/2303396.html