duplicate form submission

Discussion in 'ASP .Net' started by Boban Dragojlovic, Feb 2, 2004.

  1. I have a textbox control on a webform which contains the following
    attribute:

    AutoPostBack="True" OnTextChanged="RunSomeCode"


    if the user types something into the textbox and presses the TAB button, for
    example, everything is fine.

    But if the user types something into the textbox and then presses ENTER, the
    form is submitted twice (I traced through it, and the Form Load ... Form
    Unload cycle occurs 2 times) which causes many problems.

    Any idea why, or, more importantly, how to prevent it?
     
    Boban Dragojlovic, Feb 2, 2004
    #1
    1. Advertising

  2. do you have AutoEventWireup="false" in your <%@ page %> directive? You can
    sometimes have page_load being called twice if it is. this may be your
    problem.

    http://support.microsoft.com/default.aspx?scid=kb;EN-US;324151

    "Boban Dragojlovic" <news@_N_O_S_P_AM_dragojlovic.org> wrote in message
    news:6MxTb.20845$...
    >
    > I have a textbox control on a webform which contains the following
    > attribute:
    >
    > AutoPostBack="True" OnTextChanged="RunSomeCode"
    >
    >
    > if the user types something into the textbox and presses the TAB button,

    for
    > example, everything is fine.
    >
    > But if the user types something into the textbox and then presses ENTER,

    the
    > form is submitted twice (I traced through it, and the Form Load ... Form
    > Unload cycle occurs 2 times) which causes many problems.
    >
    > Any idea why, or, more importantly, how to prevent it?
    >
    >
    >
     
    Michael Ramey, Feb 2, 2004
    #2
    1. Advertising

  3. if I have it set to TRUE, then I get two Page_Loads immediately. Before I
    only got it if the user pressed ENTER as opposed to tabbing out of the
    field.

    So that didn't fix it.

    "Michael Ramey" <raterus@localhost> wrote in message
    news:%...
    > do you have AutoEventWireup="false" in your <%@ page %> directive? You

    can
    > sometimes have page_load being called twice if it is. this may be your
    > problem.
    >
    > http://support.microsoft.com/default.aspx?scid=kb;EN-US;324151
    >
    > "Boban Dragojlovic" <news@_N_O_S_P_AM_dragojlovic.org> wrote in message
    > news:6MxTb.20845$...
    > >
    > > I have a textbox control on a webform which contains the following
    > > attribute:
    > >
    > > AutoPostBack="True" OnTextChanged="RunSomeCode"
    > >
    > >
    > > if the user types something into the textbox and presses the TAB button,

    > for
    > > example, everything is fine.
    > >
    > > But if the user types something into the textbox and then presses ENTER,

    > the
    > > form is submitted twice (I traced through it, and the Form Load ... Form
    > > Unload cycle occurs 2 times) which causes many problems.
    > >
    > > Any idea why, or, more importantly, how to prevent it?
    > >
    > >
    > >

    >
    >
     
    Boban Dragojlovic, Feb 3, 2004
    #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. Leon Shaw

    (onetime) Form Submission

    Leon Shaw, Aug 15, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    357
  2. cool2005

    Duplicate submission prevention

    cool2005, Sep 26, 2006, in forum: Java
    Replies:
    3
    Views:
    1,950
    cool2005
    Sep 26, 2006
  3. Oleg Konovalov

    Preventing duplicate form submission

    Oleg Konovalov, Oct 31, 2006, in forum: Java
    Replies:
    14
    Views:
    1,332
  4. Jared
    Replies:
    5
    Views:
    214
    Jared
    Jul 10, 2003
  5. Oleg Konovalov

    Preventing duplicate form submission

    Oleg Konovalov, Oct 31, 2006, in forum: Javascript
    Replies:
    8
    Views:
    184
Loading...

Share This Page