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 }

 

相关文章:

  • 2021-08-06
  • 2022-12-23
  • 2021-11-04
  • 2021-12-15
  • 2021-07-02
  • 2022-01-20
  • 2021-12-07
  • 2021-05-20
猜你喜欢
  • 2021-11-11
  • 2022-12-23
  • 2021-10-27
  • 2022-02-07
  • 2021-12-22
  • 2022-12-23
相关资源
相似解决方案