Validators won't let me leave aspx form using web user controls!

Discussion in 'ASP .Net' started by Dot net work, Jun 16, 2004.

  1. Dot net work

    Dot net work Guest

    If I have got 2 web user controls on my aspx form, and one web user
    control has got some validator controls on it, what I find is that if
    I enter in some "bad data" in to some text boxes on the first web user
    control, then click on a link button on the second web user control to
    leave the aspx form, it won't let me - the validators run on the first
    web user control and highlight the errors and won't let me leave until
    I fix them. I'm trapped.
    Dot net work, Jun 16, 2004
    #1
    1. Advertising

  2. Validation controls work great for scenarios where you fill everything in
    and submit (ie, simple forms). They get to be a pain in the butt when you
    start dealing with complex logic and are best thrown out the window in those
    cases. This may not be a popular statement, but it is factual.

    You have a couple of choices.

    1. Scrap the validation controls in this exercise.
    2. Customize the validation to not validate on the second button push (could
    be a coding nightmare, especially since you are dealing with controls in a
    page).

    I prefer the easy route, as the validation controls are meant to make your
    life easier, not harder.

    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA

    ************************************************
    Think Outside the Box!
    ************************************************
    "Dot net work" <> wrote in message
    news:...
    > If I have got 2 web user controls on my aspx form, and one web user
    > control has got some validator controls on it, what I find is that if
    > I enter in some "bad data" in to some text boxes on the first web user
    > control, then click on a link button on the second web user control to
    > leave the aspx form, it won't let me - the validators run on the first
    > web user control and highlight the errors and won't let me leave until
    > I fix them. I'm trapped.
    Cowboy \(Gregory A. Beamer\) [MVP], Jun 16, 2004
    #2
    1. Advertising

  3. The validators have an enabled property. You can use client side javascript
    hooked up to each user controls button to disable the validators on the
    oposite control.

    --
    Sincerely,

    S. Justin Gengo, MCP
    Web Developer / Programmer

    www.aboutfortunate.com

    "Out of chaos comes order."
    Nietzsche
    "Dot net work" <> wrote in message
    news:...
    > If I have got 2 web user controls on my aspx form, and one web user
    > control has got some validator controls on it, what I find is that if
    > I enter in some "bad data" in to some text boxes on the first web user
    > control, then click on a link button on the second web user control to
    > leave the aspx form, it won't let me - the validators run on the first
    > web user control and highlight the errors and won't let me leave until
    > I fix them. I'm trapped.
    S. Justin Gengo, Jun 16, 2004
    #3
  4. Check out the following thread.

    http://groups.google.com/groups?hl=...*&as_drrb=q&as_qdr=y&lr=lang_en&num=100&hl=en

    --

    Alphonse Giambrone
    Email: a-giam at customdatasolutions dot us


    "Dot net work" <> wrote in message
    news:...
    > If I have got 2 web user controls on my aspx form, and one web user
    > control has got some validator controls on it, what I find is that if
    > I enter in some "bad data" in to some text boxes on the first web user
    > control, then click on a link button on the second web user control to
    > leave the aspx form, it won't let me - the validators run on the first
    > web user control and highlight the errors and won't let me leave until
    > I fix them. I'm trapped.
    Alphonse Giambrone, Jun 16, 2004
    #4
  5. Dot net work

    Dot net work Guest

    Actually, I just found another workaround:

    For the buttons and link buttons on the other web user control that
    needs to override any validators on the first web user control, set
    the CausesValidation property of these controls to false.

    -dnw.

    (Dot net work) wrote in message news:<>...
    > If I have got 2 web user controls on my aspx form, and one web user
    > control has got some validator controls on it, what I find is that if
    > I enter in some "bad data" in to some text boxes on the first web user
    > control, then click on a link button on the second web user control to
    > leave the aspx form, it won't let me - the validators run on the first
    > web user control and highlight the errors and won't let me leave until
    > I fix them. I'm trapped.
    Dot net work, Jun 16, 2004
    #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. Ratman
    Replies:
    0
    Views:
    650
    Ratman
    Sep 14, 2004
  2. Luigi Donatello Asero

    Let or not let the text float

    Luigi Donatello Asero, Jan 15, 2004, in forum: HTML
    Replies:
    6
    Views:
    464
    Steve R.
    Jan 15, 2004
  3. Aaron
    Replies:
    11
    Views:
    15,754
    Aaron
    Sep 13, 2006
  4. Nathan Sokalski
    Replies:
    2
    Views:
    377
    Nathan Sokalski
    Sep 22, 2006
  5. Nathan Sokalski
    Replies:
    2
    Views:
    113
    Nathan Sokalski
    Sep 22, 2006
Loading...

Share This Page