Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default 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.Redirect 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


    news.public.microsoft.com Guest

  2. Similar Questions and Discussions

    1. CFFORM Validation trumping Custom Form Validation
      Is there any way for custom form validation to work in concert with the cfform validation? I have a custom script that compares the values of two...
    2. Datagrid - cancel Validation
      My app is doing all edits in the datagrid footer. The footer has some columns with textboxes and validation controls that look at the textboxes....
    3. 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...
    4. validation summary doesnt display when there's client-side validation
      I have a custom validator that validates a numeric field, txtField, that allows for thousand separators. I also placed a validation summary so...
    5. only custom validation control does server side validation?
      On a CustomValidator you have to provide the validation code because otherwise it doesn't know what to do for the validation. Other validator...
  3. #2

    Default Re: Cancel validation?

    You'll love this!

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

    :)

    Justin


    "news.public.microsoft.com" <mindmover@hotmail.com> wrote in message
    news:OhSL57tSDHA.1588@TK2MSFTNGP11.phx.gbl...
    > 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.Redirect 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 Guest

  4. #3

    Default Re: Cancel validation?

    Hi

    What about redirecting on the client

    cancelbtn.CausesValidation = false;
    cancelbtn.Attributes.Add("onclick","location.href= 'theRedirectPage.aspx';
    return false");

    --
    Best Regards
    Vidar Petursson
    ==============================
    Microsoft Internet Client & Controls MVP
    ==============================
    "news.public.microsoft.com" <mindmover@hotmail.com> wrote in message
    news:OhSL57tSDHA.1588@TK2MSFTNGP11.phx.gbl...
    > 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.Redirect 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
    >
    >

    Vidar Petursson Guest

  5. #4

    Default 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:vh8695js29dtd7@corp.supernews.com...
    > You'll love this!
    >
    > In the cancel button's properties list find "CausesValidation" and set it
    to
    > false.
    >
    > :)
    >
    > Justin
    >
    >
    > "news.public.microsoft.com" <mindmover@hotmail.com> wrote in message
    > news:OhSL57tSDHA.1588@TK2MSFTNGP11.phx.gbl...
    > > 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.Redirect 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
    > >
    > >
    > >
    >
    >

    news.public.microsoft.com Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139