I am using DropdownBox and TextBox in my c# application.
I need to validate that either DropdownBox item should be selected or TextBox should have the value
But not both have value.
How can I apply validation on both together?
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.
Something like this (with a
CustomValidatorcontrol):The conditions on the
ifstatement will depend on your validation requirements, but this gives a general idea of what to do. Hope it helps!See this this post for some good details about validation.
NOTE: You don’t need to assign a
ControlToValidateto aCustomValidator. Just set the above function as theServerValidateevent for theCustomValidatorand it will fire when the page submits.