Cancel validation?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • news.public.microsoft.com

    #1

    Cancel validation?

    Hi everyone,

    I have a VB.NET web form with some field validators and Save and Cancel
    buttons. What I want to do is on the Cancel button On_Click event,
    Response.Redire ct to another page. The problem is that the client-side
    validation occurs before even reaching the event for the Cancel button.
    I've tried some ways to disable only the client-side validation, but I find
    it a poor design that you can't have a command button bypass the jscript
    validation routines.

    Anyone found a workaround for this? Surely this problem occured before.

    Thanks in advance for any help.

    Eric


  • S. Justin Gengo

    #2
    Re: Cancel validation?

    You'll love this!

    In the cancel button's properties list find "CausesValidati on" and set it to
    false.

    :)

    Justin


    "news.public.mi crosoft.com" <mindmover@hotm ail.com> wrote in message
    news:OhSL57tSDH A.1588@TK2MSFTN GP11.phx.gbl...[color=blue]
    > Hi everyone,
    >
    > I have a VB.NET web form with some field validators and Save and Cancel
    > buttons. What I want to do is on the Cancel button On_Click event,
    > Response.Redire ct to another page. The problem is that the client-side
    > validation occurs before even reaching the event for the Cancel button.
    > I've tried some ways to disable only the client-side validation, but I[/color]
    find[color=blue]
    > it a poor design that you can't have a command button bypass the jscript
    > validation routines.
    >
    > Anyone found a workaround for this? Surely this problem occured before.
    >
    > Thanks in advance for any help.
    >
    > Eric
    >
    >
    >[/color]


    Comment

    • Vidar Petursson

      #3
      Re: Cancel validation?

      Hi

      What about redirecting on the client

      cancelbtn.Cause sValidation = false;
      cancelbtn.Attri butes.Add("oncl ick","location. href='theRedire ctPage.aspx';
      return false");

      --
      Best Regards
      Vidar Petursson
      =============== ===============
      Microsoft Internet Client & Controls MVP
      =============== ===============
      "news.public.mi crosoft.com" <mindmover@hotm ail.com> wrote in message
      news:OhSL57tSDH A.1588@TK2MSFTN GP11.phx.gbl...[color=blue]
      > Hi everyone,
      >
      > I have a VB.NET web form with some field validators and Save and Cancel
      > buttons. What I want to do is on the Cancel button On_Click event,
      > Response.Redire ct to another page. The problem is that the client-side
      > validation occurs before even reaching the event for the Cancel button.
      > I've tried some ways to disable only the client-side validation, but I[/color]
      find[color=blue]
      > it a poor design that you can't have a command button bypass the jscript
      > validation routines.
      >
      > Anyone found a workaround for this? Surely this problem occured before.
      >
      > Thanks in advance for any help.
      >
      > Eric
      >
      >[/color]


      Comment

      • news.public.microsoft.com

        #4
        Re: Cancel validation?

        Doh, it was almost jumping at me. I thought that this property controlled
        if the control generated validation on the server. Wasn't sure about the
        client-side.

        Thanks a lot!

        "S. Justin Gengo" <gengoj@krause. com> wrote in message
        news:vh8695js29 dtd7@corp.super news.com...[color=blue]
        > You'll love this!
        >
        > In the cancel button's properties list find "CausesValidati on" and set it[/color]
        to[color=blue]
        > false.
        >
        > :)
        >
        > Justin
        >
        >
        > "news.public.mi crosoft.com" <mindmover@hotm ail.com> wrote in message
        > news:OhSL57tSDH A.1588@TK2MSFTN GP11.phx.gbl...[color=green]
        > > Hi everyone,
        > >
        > > I have a VB.NET web form with some field validators and Save and Cancel
        > > buttons. What I want to do is on the Cancel button On_Click event,
        > > Response.Redire ct to another page. The problem is that the client-side
        > > validation occurs before even reaching the event for the Cancel button.
        > > I've tried some ways to disable only the client-side validation, but I[/color]
        > find[color=green]
        > > it a poor design that you can't have a command button bypass the jscript
        > > validation routines.
        > >
        > > Anyone found a workaround for this? Surely this problem occured before.
        > >
        > > Thanks in advance for any help.
        > >
        > > Eric
        > >
        > >
        > >[/color]
        >
        >[/color]


        Comment

        Working...