Asp net validating a checkboxlist control

It saves a great deal of time in hand coding Java Script validation.

Unfortunately, validation controls don’t work with the Check Box or Check Box List controls.

will point the validator at the property to validate against.

The Check Box, Radio Button, Html Input Check Box and Html Input Radio Button lack this attribute, accordingly, any standard validation control will throw an exception Finally, if you like the article and find the control useful, then please Kick It (using the button below) and it would be kind of you to leave a comment. I have also created the Multiple Fields Validator validator control to tackle the problem of validating multiple controls.

These checkbox lists are created dynamically at runtime. Add(txt Dummy); // add custom validation control Custom Validator val Check = new Custom Validator(); val Check.

This is what I did: I created a dummy textbox and put the ID of the checkboxlist as the value inside the text box.

I found many solutions from searching on the Internet, but most of them didn’t work very well, if at all, and very few were designed for use with an asp: Check Box.

I sent the textbox as the control to validate, and then got the ID of my "real" control to validate from the value that was sent to the validation function, and used it to find my checkbox list and perform the validation checks.

But of course I didn't want the user to see the dummy text box. When I did that, the validation method was never called. NET does not perform validation for a control whose visibility is false.

Hi Rahul, I guess you want to show a Requierd Field Validator for ASP Check Box List.

But there is no field in the Check Box List to fill, so Requierd Field Validator doesn't work for this Control.

Search for asp net validating a checkboxlist control:

asp net validating a checkboxlist control-63asp net validating a checkboxlist control-15asp net validating a checkboxlist control-35asp net validating a checkboxlist control-50

Leave a Reply

Your email address will not be published. Required fields are marked *

One thought on “asp net validating a checkboxlist control”

  1. But you can​—you must—​rise above that kind of thinking! So before you’re ready to focus on one particular person, you need to take time to study a very important “subject”—how to build friendships.

  2. Extended profile settings including info, photos and video to make a comprehensive self-presentation and to find a soul mate easy. Live exclusive dating parties organized by Bridge of Love.