Server-side events do not fire the first time after client-side validators have fired

Discussion in 'ASP .Net' started by Stuart Whiteford, Apr 24, 2006.

  1. Hi,

    I asked this back in January without answer and forgot about it until now.

    I've got a basic web form, two textboxes, a couple of radio button groups,
    some required field validators, and a Submit and Cancel button.

    When the page loads, if I click the Cancel button, the server-side event
    fires as normal.

    However, if I click the Submit button (with no information entered) the
    client-side validators fire, but if I then decide to press the Cancel
    button, nothing happens, I need to press it a second time before the
    server-side event fires.

    I've now noticed that no server-side events fire the first time after the
    client-side validation has fired. Not so much of a problem with a Cancel
    button, but a nightmare for DropDownLists with AutoPostBack enabled!

    TIA,
    Stuart.
    Stuart Whiteford, Apr 24, 2006
    #1
    1. Advertising

  2. RE: Server-side events do not fire the first time after client-side va

    hello,

    if isValid is false, the server side code should never fire?

    "Stuart Whiteford" wrote:

    > Hi,
    >
    > I asked this back in January without answer and forgot about it until now.
    >
    > I've got a basic web form, two textboxes, a couple of radio button groups,
    > some required field validators, and a Submit and Cancel button.
    >
    > When the page loads, if I click the Cancel button, the server-side event
    > fires as normal.
    >
    > However, if I click the Submit button (with no information entered) the
    > client-side validators fire, but if I then decide to press the Cancel
    > button, nothing happens, I need to press it a second time before the
    > server-side event fires.
    >
    > I've now noticed that no server-side events fire the first time after the
    > client-side validation has fired. Not so much of a problem with a Cancel
    > button, but a nightmare for DropDownLists with AutoPostBack enabled!
    >
    > TIA,
    > Stuart.
    >
    >
    >
    =?Utf-8?B?Sm9u?=, Apr 24, 2006
    #2
    1. Advertising

  3. Re: Server-side events do not fire the first time after client-side va

    Hi,

    It's not the server code that would fire if the page was valid, it's any
    server-side code on the page.

    Once the validator have fired client-side, I then go and change a
    DropDownList with AutoPostBack enable, and the PostBack does not happen (the
    CausesValidation is false on the DropDownList).

    Stuart.


    "Jon" <> wrote in message
    news:...
    > hello,
    >
    > if isValid is false, the server side code should never fire?
    >
    > "Stuart Whiteford" wrote:
    >
    >> Hi,
    >>
    >> I asked this back in January without answer and forgot about it until
    >> now.
    >>
    >> I've got a basic web form, two textboxes, a couple of radio button
    >> groups,
    >> some required field validators, and a Submit and Cancel button.
    >>
    >> When the page loads, if I click the Cancel button, the server-side event
    >> fires as normal.
    >>
    >> However, if I click the Submit button (with no information entered) the
    >> client-side validators fire, but if I then decide to press the Cancel
    >> button, nothing happens, I need to press it a second time before the
    >> server-side event fires.
    >>
    >> I've now noticed that no server-side events fire the first time after the
    >> client-side validation has fired. Not so much of a problem with a Cancel
    >> button, but a nightmare for DropDownLists with AutoPostBack enabled!
    >>
    >> TIA,
    >> Stuart.
    >>
    >>
    >>
    Stuart Whiteford, Apr 25, 2006
    #3
    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. Replies:
    3
    Views:
    1,134
    bruce barker
    Feb 25, 2004
  2. Stuart Whiteford
    Replies:
    0
    Views:
    518
    Stuart Whiteford
    Jan 9, 2006
  3. Vili
    Replies:
    5
    Views:
    413
    siccolo
    Feb 19, 2008
  4. ton

    events won't fire first time

    ton, Nov 5, 2010, in forum: ASP .Net
    Replies:
    0
    Views:
    636
  5. Guest

    Fire server side event before client side event

    Guest, Mar 17, 2005, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    583
    Ken Cox [Microsoft MVP]
    Mar 18, 2005
Loading...

Share This Page