後臺添加: Button1.Attributes.Add("onclick", "return confirm('are you sure?')");
在表單添加:<form onSubmit="return check();">
在button的單擊客戶端事件進行驗證了:
1.1 <asp:Button id ="x" runat="server" οnclick="return check();"......
2.0 <asp:Button id ="x" runat="server" onclientclick="return check();"...