Questions tagged «onclientclick»

8
OnClick与OnClientClick的asp:CheckBox吗?
有谁知道为什么asp:CheckBox的客户端javascript处理程序需要像asp:Button那样是OnClick =“”属性而不是OnClientClick =“”属性? 例如,这有效: <asp:CheckBox runat="server" OnClick="alert(this.checked);" /> 并且没有(没有错误): <asp:CheckBox runat="server" OnClientClick="alert(this.checked);" /> 但这有效: <asp:Button runat="server" OnClientClick="alert('Hi');" /> 这不会(编译时错误): <asp:Button runat="server" OnClick="alert('hi');" /> (我知道Button.OnClick的用途;我想知道为什么CheckBox不能以相同的方式工作...)
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.