Export (0) Print
Expand All
0 out of 1 rated this helpful - Rate this topic

How to: Get and Set a CheckBox Web Server Control Value Programmatically 

You can programmatically read or set the value of a CheckBox Web server control.

NoteNote

If you are working with a CheckBoxList control, the procedure for getting and setting the value of a check box is different. For details, see How to: Determine the Selection in List Web Server Controls.

To get or set CheckBox Web server control selection

  • Get or set the CheckBox control's Checked property. A value of true means the check box is selected.

    NoteNote

    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 chkCanWeSendEmail is not selected, the check box chkSendInHTMLFormat is automatically cleared as well.

    If chkCanWeSendEmail.Checked = False Then
       chkSendInHTMLFormat.Checked = False
    End If
    

    if(chkCanWeSendEmail.Checked == false){
       chkSendInHTMLFormat.Checked = false;
    }
    

See Also

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.