473,471 Members | 1,684 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Execution order of Validation Controls

I have 3 labels called eventDate, eventStartTime and eventEndTime.

I have 3 validators as well. One checks to make sure that a date is
specified (RequiredFieldValidator), the other makes sure that the date
is valid (CompareFieldValidator) and the third (a custom validator)
makes sure that the eventStartTime is before the eventEndTIme. The
custom validator takes the eventDate and start/end times, creates 2
variables of type DateTime and does a compare.

Is there a way for me to define the order in which the validators will
run? I'd like the Required to run first, follwoed by the Compare and
then the Custom.

Thx.

Bijoy
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #1
1 4172
You can do it manually
e.g.
on submit, instead of call Page.Validate() method you can use

RequiredFieldValidator.Validate();
if ( RequiredFieldValidator.IsValid )
{
CompareFieldValidator.Validate();
if ( CompareFieldValidator.IsValid )
{
CustomValidator.Validate();
if ( CustomValidator.IsValid )
{
}
}
}

for this you have to perform the validation on the server and set the
EnableClientScript = False

Regards
Martin

"Bijoy Naick" <b_*****@donoteamil.yahoo.ca> wrote in message
news:eF**************@TK2MSFTNGP12.phx.gbl...
I have 3 labels called eventDate, eventStartTime and eventEndTime.

I have 3 validators as well. One checks to make sure that a date is
specified (RequiredFieldValidator), the other makes sure that the date
is valid (CompareFieldValidator) and the third (a custom validator)
makes sure that the eventStartTime is before the eventEndTIme. The
custom validator takes the eventDate and start/end times, creates 2
variables of type DateTime and does a compare.

Is there a way for me to define the order in which the validators will
run? I'd like the Required to run first, follwoed by the Compare and
then the Custom.

Thx.

Bijoy
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Matt | last post by:
I want to know if ASP.NET Web Forms Validation Controls are Server-Side or Client-Side form validation? Since I think each validator control can select either 1) JavaScript based error dialog or 2)...
2
by: Bill Borg | last post by:
Hello all I am trying to understand the execution order of the PageLoad routines in two different user controls on the same page. In particular, I need one to execute before the other, but I...
6
by: Stephen | last post by:
Hi, the validation controls dont work on Netscape or Mozilla and only on Internet Explorer why? How do i correct this problem? Thanks
2
by: Martyn Fewtrell | last post by:
Dear All I have a Windows 2003 Server with IIS6 where the validation controls on ASP.Net pages no longer work. I believe it to be specific to the server as if I create an ASP.Net page on the...
1
by: Chris Rumsey via .NET 247 | last post by:
I want to be able to control the order error messages appear in the validation summary. They always seem to appear in reverse order ie not in the same order that the validation controls appear on the...
2
by: Tim Frawley | last post by:
Source code attached indicates my problem with validation and a button bar save button. Fill the Textbox with some text then tab off the control. The message box will display the text in the...
1
by: Tarun Mistry | last post by:
Hi there everyone, I have a page containing dynamic user controls. The main page contains a custom validator that checks the dynamic user controls, this works fine. However, I only want the...
3
by: Papanii | last post by:
Hello Guys, I have a little problem that i need some ideas as to how to solve. I have a form that sends some data to the server once filled. Now, for this form i am using asp.net validation...
11
nathj
by: nathj | last post by:
Hi, I have a strange problem, my code is running too quickly. Allow me to explain (if I can). I am using the XMLHTTP object in order to query the database as a user completes the membership...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.