2 CustomValidators in a Page ?

T

Tiësto

Does it represent an error? I couldn't get to work 2 of them, I and thought
maybe it isn't possible, and the two server validation functions must be put
together.
 
S

Steven Cheng[MSFT]

Hi ,

Thanks for posting. As for the put multi custom valicator s on asp.net page
you mentioned, is the custom validtor you use have both clientside
validation and serverside validtion? If it has clientside valiation, maybe
sometimes when one validator capture errors, it will prevent the other
validtor from contintue to validate. I think you can try disable the
clientside valition and only use serverside valition to see whether both of
the 2 custom validators work. Generally at serverside, the page will loop
through all the validators (enabled) on tha page and call their validate
functions. Here is a tech article on this:

#ASP.NET Validation in Depth
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html
/aspplusvalid.asp

Hope helps.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
T

Tiësto

Thanks again Steven.

Both controls had their EnableClientScript property set to false, and when I
was debugging, I was debugging on the server. But I put a breakpoint on the
second "ServerValidate" method and it was never consulted to see if the page
was valid. A call to SecondControl.Validate was necessary for de event
handler to be proccesed.

When I had already put both validations on a single ServerValidate event
handler, (but leaving aline with a breakpoint on the second) this second EH
started to work. This kind of things happen, don't worry. Thanks a lot.
 
S

Steven Cheng[MSFT]

Thanks for your followup.

Anyway, glad that you've found the cause of the problem.
Also, if there're anything else we can help later, please feel free to
post. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top