Solved

ASP.NET : CustomValidator control does not validate!

Posted on 2003-11-14
1
3,000 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Consuming WCF service from Java with callback contract 5 256
CSS display:none AND display:block on same element 3 78
Adjust the position 3 49
Download a website to hdd 2 50
Article by: Matthew
I am a very big proponent of technology compliance standards and strive to meet such criteria in all of my work. That includes my site, which is 100% XHTML 1.0 compliant as determined by the World Wide Web Consortium. https://www.matthewstevenkel…
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
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…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

920 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now