CheckBoxValidator Control
Description
The CheckBoxValidator validates that a CheckBox control is checked or unchecked. This can be useful if you want to require someone to check a checkbox at the bottom of a form before submitting it, for example, to verify that all entered information is correct.
Example


The following tags were used to create the validators used in the two examples above:
Properties & Methods
CheckBoxValidatorThe CheckBoxValidator is used to validate whether a CheckBox is checked or unchecked.
  • CheckBoxToValidate - The CheckBox to be validated. This property is used in place of the ControlToValidate property inherited from the BaseValidator class because ControlToValidate will not accept CheckBoxes.
  • RequiredValue - A Boolean value specifying whether the CheckBox specified must be checked or unchecked to pass validation (True for checked, False for unchecked, default="True").
  • GenerateErrorMessage - Specifies whether a custom or generated error message should be used (default="True")
Source Code
CheckBoxValidator.vb:

Remarks
When specifying the checkbox to validate, be sure to use CheckBoxToValidate and NOT ControlToValidate, otherwise, you may receive an error.