I have 20 RadioButtonLists on a page.
I need to create a validation method to ensure that at least one of these RadioButtonLists has an item selected.
What kind of validation would I need to use for this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
EDIT: Updated question based on comments and clarification.
If you are validating against multiple
RadioButtonLists then you need to use aCustomValidatorand implement the server side check.Here is some test markup:
Use the following extension method to find all the
RadioButtonListcontrols (Source):Then implement the server side
CustomValidatorcheck:I have tested the above example and it seems to do exactly what you need. You should be able to switch it to VB pretty easily. Hope this solves your problem.