Clientside Validation in UserControls

M

MattC

I have a user control that contains several requiredFieldValidators. The
page the control sits in has other RequiredFieldValidators. On submitting
the form all the validators on the page fire and correctly validate. The
validators in the control seem to validate but do not return true/IsValid as
so my form is not submitted.

I would like to do this ClientSide, the only resolution I can find is to
perform the validation for the usercontrol Server Side, but this has
implications with the a password textbox which will (rightly) not retain
viewstate over a postback. Is there something that I need to set in my user
control to allow clientside validation?

TIA

MattC
 
P

Peter Blum

It sounds like you have two groups of controls that have separate submit
buttons which should fire their own validators. ASP.NET 1.x doesn't handle
this case without using server side validation. ASP.NET 2.0 introduces
Validation Groups, which lets you assign a group name to the submit control
and the validators it fires. My Professional Validation And More
(http://www.peterblum.com/vam/home.aspx), which works with ASP.NET 1.x, also
includes Validation Groups in its 25 validators.

These are the solutions if you trying to keep client-side validation active.

--- Peter Blum
www.PeterBlum.com
Email: (e-mail address removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
 

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

No members online now.

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top