Clientside Validation in UserControls

Discussion in 'ASP .Net' started by MattC, Jul 22, 2005.

  1. MattC

    MattC Guest

    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
    MattC, Jul 22, 2005
    #1
    1. Advertising

  2. MattC

    Peter Blum Guest

    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:
    Creator of "Professional Validation And More" at
    http://www.peterblum.com/vam/home.aspx

    "MattC" <> wrote in message
    news:...
    >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
    >
    >
    Peter Blum, Jul 22, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eddie Dodd

    Clientside validation not working

    Eddie Dodd, May 26, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    457
    Eddie Dodd
    May 27, 2004
  2. Dennis Calla

    Clientside validation not working.

    Dennis Calla, Jan 13, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    422
    Peter Blum
    Jan 13, 2005
  3. Paul
    Replies:
    1
    Views:
    2,068
    Scott Allen
    May 25, 2005
  4. Kris
    Replies:
    1
    Views:
    597
    Peter Blum
    Jun 30, 2005
  5. IkBenHet
    Replies:
    1
    Views:
    1,445
    Peter Blum
    Aug 10, 2005
Loading...

Share This Page