Because CheckBox doesn’t have a Value property I tried the following:
And tried to access it from javacstipt:
I was surprised to find out that the message in the alert was “on” and not “test” as I expected so I looked at the source of the page and this is what I saw:
As you can see the value I set on the server side code doesn’t appear in the result html code.
After a little more research I found out there is a property for the CheckBox that is called “InputAttributes” – this property adds the attributes to the CheckBox input.
This is the correct code:
That’s all I needed.