Saturday, 13 August 2011

ASP.Net CheckBox OnClick / OnClientClick

The short story is: an ASP.Net CheckBox control (or any other control aside from Button) does not have an OnClick or OnClientClick event.

One way to over come this is to use the InputAttributes (for CheckBox, RadioButton controls) or Attributes (for TextBox controls)collection.

Add an entry to this collection using the same syntax as an HTML onclick event handler:

<example code>

You can now define Client Side event handling in Server Side code!

No comments:

Post a Comment