Solved

ASP.NET : CustomValidator control does not validate!

Posted on 2003-11-14
1
2,996 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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
The viewer will learn how to dynamically set the form action using jQuery.

762 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

8 Experts available now in Live!

Get 1:1 Help Now