Each Required Field Validator can validate 1 Controller, but let’s say I have 3 DropDownLists.
Date of Birth:
-Day- -Month- -Year-
Now I know that I can validate 1 DropDownList by setting the InitialValue, where the first Item in the DropDownList is “Select a Day”, which has a Value=””.
But I do not want to use 3 validators. (Day is missing, Month is missing, Year is missing)
I wish to use 1 Validator for all 3, means, if I set the day and the month but I don’t set the year, I get (Date must be set), same thing If I set the day and the year without the month..etc…
I know that I can do this with a custom validator, but can I do it with 1 Required Field Validator? Because usually Custom validators requires the page to be refreshed (so it can execute server side codes).
You can use validation summary
And remove the ErrorMessage ,InitialValue and Text properties of required field validator of dropdowns.
This will give you required output.