471,066 Members | 1,288 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,066 software developers and data experts.

Clientside Validation in UserControls

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
Nov 19 '05 #1
1 1398
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: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"MattC" <m@m.com> wrote in message
news:Oz**************@TK2MSFTNGP10.phx.gbl...
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

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Niclas Lindblom | last post: by
4 posts views Thread by TJS | last post: by
2 posts views Thread by Eric Maia | last post: by
1 post views Thread by Paul | last post: by
3 posts views Thread by Jon Paal | last post: by
7 posts views Thread by mc | last post: by

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.