Bypass validation on cancel

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Corey Olsen

    Bypass validation on cancel

    Can anyone point me to some documentation on bypassing validation controls
    when a user selects cancel?

    What I have is a user control with a form to fill out information on a
    subject. The user should be presented with two buttons a "Submit" and a
    "Cancel". When the "Cancel" button is selected all of the items on the user
    control should be cleared. However, I have validation controls setup for
    each item necessary on the form and when hitting cancel all of the
    validation controls activate preventing cancel from being activated. How
    can I make this button "bypass" the validation sequence so that just the
    form is cleared?

    This seems like it would need to be a javascript handled event on the client
    side so that it acts like a 'clear' method and doesn't actually submit
    anything. I could write that in to the application but I'm wondering if
    there is a way to do this in ASP.NET "style" without having to introduce
    javascript.

    Thanks,
    Corey


  • Jurjen de Groot

    #2
    Re: Bypass validation on cancel

    Corey,

    I had the same problem but if you set the CauseValidation property of the
    cancel button to False your problem is solved.

    regards,

    Jurjen de Groot
    G.I.T.S. Netherlands

    "Corey Olsen" <pbyfra@gnyjro. arg> wrote in message
    news:e$lPRwyPDH A.1608@TK2MSFTN GP11.phx.gbl...[color=blue]
    > Can anyone point me to some documentation on bypassing validation controls
    > when a user selects cancel?
    >
    > What I have is a user control with a form to fill out information on a
    > subject. The user should be presented with two buttons a "Submit" and a
    > "Cancel". When the "Cancel" button is selected all of the items on the[/color]
    user[color=blue]
    > control should be cleared. However, I have validation controls setup for
    > each item necessary on the form and when hitting cancel all of the
    > validation controls activate preventing cancel from being activated. How
    > can I make this button "bypass" the validation sequence so that just the
    > form is cleared?
    >
    > This seems like it would need to be a javascript handled event on the[/color]
    client[color=blue]
    > side so that it acts like a 'clear' method and doesn't actually submit
    > anything. I could write that in to the application but I'm wondering if
    > there is a way to do this in ASP.NET "style" without having to introduce
    > javascript.
    >
    > Thanks,
    > Corey
    >
    >[/color]


    Comment

    Working...