First time here? You are looking at the most recent posts. You may also want to check out older archives or the tag cloud. Please leave a comment, ask a question and consider subscribing to the latest posts via RSS. Thank you for visiting! (hide this)

CheckBoxList

There are 1 entries for the tag CheckBoxList

How to add a required validator to a CheckBoxList

If you add a normal RequiredFieldValidator and you want to validate a CheckBoxList, you will get a runtime exception informing you that the CheckBoxList cannot be validated. Sometimes you want to make sure the that user has selected at least one of the checkbox in the checkbox list, but as aforementioned, if you user a normal RequiredFieldValidator you will get an exception. You could use a CustomValidator control, but a nicer and more reusable approach is to build a custom web control that extends the BaseValidator. I found a 2001 article on how to do that (Building a CheckBoxList Validator Control) but...