I had a couple of asp projects in my first year and I used to validate the checkboxelist in the following way. The following code is sufficient to validate a CheckBoxList in such a way that exactly two entries must be chosen so that the control is valid:
Code:
< asp:CheckBoxList ID ="chkListTest" runat ="server" >
< asp:ListItem Text ="Eintrag Eins" />
< asp:ListItem Text ="Eintrag Zwei" />
</ asp:CheckBoxList >
< t4m:CheckBoxListValidator
ID ="valGeschlecht"
ControlToValidate ="chkListTest"
ErrorMessage ="Bitte genau zwei Optionen auswählen"
EqualsChecked ="2"
runat ="server" />
Bookmarks