Custom Validation Control within Wizard Control 8(

Discussion in '.NET' started by JimmyLoh, Aug 28, 2007.

  1. JimmyLoh

    JimmyLoh

    Joined:
    Aug 28, 2007
    Messages:
    4
    I have a check box that I want to require the user to check before going to the next page of my wizard control.

    All my other validations, such as a name text box that has a requiredfieldvalidator assigned to it fires on the click of the "next" button in the wizard control.

    So, I added a custom validation control to the check box and when I debug I can see that my method is getting hit and the page is not valid is getting set to false, yet the wizard control still goes to the next page and the text for the custom validation control doesn't display.

    Here is the code for the CustomValidator and when I debug, I do see that it is getting executed when the "next" button is hit in the wizard control, but the wizard control still goes to the next page rather then stop and require the required fields to be validated as it does for a textbox/requiredfieldvalidator.

    protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
    {
    if (cbCodeOfConduct.Checked == false)
    {
    args.IsValid = false;
    }
    else
    {
    args.IsValid = true;
    }
    }

    Can anyone offer me any help on this?
    Thanks so much,
    JimmyL

    EDIT:
    In order to try to clarify more:
    In page 2 of my wizard control I have a text box that has a required field validator assigned to it.
    If the user clicks next in the wizard to go to page 3, the validator fires and they do not go to page 2 until they enter some text.

    I want to do the same functionality with a check box. Right now I am trying to use the custom validation control to do it, but it isn't working.


    Thanks again.
    JimmyL
     
    Last edited: Aug 28, 2007
    JimmyLoh, Aug 28, 2007
    #1
    1. Advertising

  2. JimmyLoh

    JimmyLoh

    Joined:
    Aug 28, 2007
    Messages:
    4
    Bump.......:beer:
     
    JimmyLoh, Aug 29, 2007
    #2
    1. Advertising

  3. JimmyLoh

    JimmyLoh

    Joined:
    Aug 28, 2007
    Messages:
    4
    Bump.....:beer:
     
    JimmyLoh, Aug 29, 2007
    #3
  4. JimmyLoh

    JimmyLoh

    Joined:
    Aug 28, 2007
    Messages:
    4
    bump......:mmmpepsi:
     
    JimmyLoh, Aug 30, 2007
    #4
  5. JimmyLoh

    deaconb

    Joined:
    Aug 19, 2008
    Messages:
    1
    I'm having this same issue... did you ever find a resolution?

    TIA
     
    deaconb, Aug 19, 2008
    #5
    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. Jonah Olsson
    Replies:
    1
    Views:
    585
    Scott Allen
    Apr 5, 2005
  2. J R M
    Replies:
    2
    Views:
    438
    Charlie@CBFC
    Jun 1, 2006
  3. bhakta.ram@gmail.com

    ASP.NET Wizard with Wizard Steps being User Controls

    bhakta.ram@gmail.com, Sep 21, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    618
    bhakta.ram@gmail.com
    Sep 21, 2006
  4. Andy B
    Replies:
    0
    Views:
    449
    Andy B
    Apr 19, 2008
  5. Matt Sokol
    Replies:
    2
    Views:
    397
    Theo Tillotson
    Aug 7, 2003
Loading...

Share This Page