|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.|
How to: Get and Set a CheckBox Web Server Control Value Programmatically
You can programmatically read or set the value of aWeb server control.
If you are working with acontrol, the procedure for getting and setting the value of a check box is different. For details, see .
To get or set CheckBox Web server control selection
Get or set the CheckBox control'sproperty. A value of true means the check box is selected.
Testing the value of a check box does not tell you if the user changed the value of the control, only if it is selected.
In the following example, if the check box
chkCanWeSendEmailis not selected, the check box
chkSendInHTMLFormatis automatically cleared as well.