OnClick vs OnClientClick for an asp:CheckBox?

后端 未结 8 1406
我在风中等你
我在风中等你 2020-12-07 16:33

Does anyone know why a client-side javascript handler for asp:CheckBox needs to be an OnClick=\"\" attribute rather than an OnClientClick=\"\" attribute, as for asp:Button?<

8条回答
  •  醉酒成梦
    2020-12-07 17:03

    I was cleaning up warnings and messages and see that VS does warn about it: Validation (ASP.Net): Attribute 'OnClick' is not a valid attribute of element 'CheckBox'. Use the html input control to specify a client side handler and then you won't get the extra span tag and the two elements.

提交回复
热议问题