Solved

ASP.NET : CustomValidator control does not validate!

Posted on 2003-11-14
1
3,002 Views
Last Modified: 2008-03-03
In my asp.net page i have a textbox and two checkboxes.I added a custom validator control and set its onservervalidate property to a vb.net server side function. This function basically checks that if either one of the two checkboxes is checked, the user must enter something in the textbox. Now during runtime, if the user does not type anything in the textbox and checks the checkbox, the validation function isnt fired.On the other hand if the user types something in the textbox, the function is fired and of course the validation passes the test.

Any ideas anyone?

thanks
0
Comment
Question by:arvindsha
1 Comment
 
LVL 2

Accepted Solution

by:
sergey_okhotny earned 125 total points
ID: 9823185
If you do not set property ControlToValidate of your customvalidator, then validate function will be fired each time.
In function you'll check checkbox status and textbox value and, if something is bad,then set args.IsValid=false;
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
video playback resume on webpages 2 73
How to analyze web traffic logs 10 108
Node js - send response after all promises are resolved 1 57
React or Angular? 6 73
When you work with shopping cart / ecommerce relates web sites, you need to pass the certain form post details to the payment gateway process page with required details for the products items you give to order. Also you may need to track the ordered…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question