SelectedCountValidator Control
Description
The SelectedCountValidator inherits from System.Web.UI.WebControls.BaseValidator and is used to validate how many CheckBoxes in a CheckBoxList or ListItems in a ListBox are selected.
Example




Properties & Methods
SelectedCountValidatorThe SelectedCountValidator inherits from System.Web.UI.WebControls.BaseValidator and is used to validate how many CheckBoxes in a CheckBoxList or ListItems in a ListBox are selected.
  • ControlToValidate - (Inherited from BaseValidator) The ID of the CheckBoxList or ListBox for which a minimum and/or maximum number of selected items will be specified
  • MinimumSelected - The minimum number of items that must be checked or selected
  • MaximumSelected - The maximum number of items that may be checked or selected
  • GenerateErrorMessage - A Boolean value specifying whether the ErrorMessage property should be automatically generated (Default="True")
Source Code
SelectedCountValidator.vb:



SelectedCountValidator.js:

Remarks
Although the SelectedCountValidator will correctly validate a ListBox that has SelectionMode="Single", it is normally used only when SelectionMode="Multiple".