double posting problem

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

  1. I have a webform that shows a long list of customers (500 - 1000) to the
    user.



    At the top of the form are various filtering options, including a quick
    search input box.



    If you set any filters, you need to click on the 'Filter' button to apply
    the filter. In that case the form posts back to the server and performs the
    filter.



    But the quick search is designed to work easier/faster. If you type
    anything into that box, and press tab, it posts back to the server
    immediately and performs a search based on the text you entered.



    I achieve this by coding these attributes into the quick search textbox:

    AutoPostBack="True" OnTextChanged="QuickSearch"





    Everything works fine if the user types something and presses Tab.



    But, if the user types something into the quick search textbox, and presses
    ENTER instead of TAB, then the form posts TWICE instead of once, and I wind
    up duplicating data on the screen.





    Currently the @Page directive has AutoEventWireup="false"



    If I changed that to TRUE, it's even worse (it ALWAYS double posts).





    Any ideas?
     
    Boban Dragojlovic, Feb 4, 2004
    #1
    1. Advertising

  2. You'll have to write a JavaScript routine that captures the ENTER key and
    reacts appropriately.

    --
    HTH,
    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    Big things are made up
    of lots of little things.

    "Boban Dragojlovic" <news@_N_O_S_P_AM_dragojlovic.org> wrote in message
    news:AmdUb.21526$...
    > I have a webform that shows a long list of customers (500 - 1000) to the
    > user.
    >
    >
    >
    > At the top of the form are various filtering options, including a quick
    > search input box.
    >
    >
    >
    > If you set any filters, you need to click on the 'Filter' button to apply
    > the filter. In that case the form posts back to the server and performs

    the
    > filter.
    >
    >
    >
    > But the quick search is designed to work easier/faster. If you type
    > anything into that box, and press tab, it posts back to the server
    > immediately and performs a search based on the text you entered.
    >
    >
    >
    > I achieve this by coding these attributes into the quick search textbox:
    >
    > AutoPostBack="True" OnTextChanged="QuickSearch"
    >
    >
    >
    >
    >
    > Everything works fine if the user types something and presses Tab.
    >
    >
    >
    > But, if the user types something into the quick search textbox, and

    presses
    > ENTER instead of TAB, then the form posts TWICE instead of once, and I

    wind
    > up duplicating data on the screen.
    >
    >
    >
    >
    >
    > Currently the @Page directive has AutoEventWireup="false"
    >
    >
    >
    > If I changed that to TRUE, it's even worse (it ALWAYS double posts).
    >
    >
    >
    >
    >
    > Any ideas?
    >
    >
    >
    >
     
    Kevin Spencer, Feb 4, 2004
    #2
    1. Advertising

  3. Can you explain to me what is happening...

    What do the two post events represent?



    "Kevin Spencer" <> wrote in message
    news:...
    > You'll have to write a JavaScript routine that captures the ENTER key and
    > reacts appropriately.
    >
    > --
    > HTH,
    > Kevin Spencer
    > .Net Developer
    > Microsoft MVP
    > Big things are made up
    > of lots of little things.
    >
    > "Boban Dragojlovic" <news@_N_O_S_P_AM_dragojlovic.org> wrote in message
    > news:AmdUb.21526$...
    > > I have a webform that shows a long list of customers (500 - 1000) to the
    > > user.
    > >
    > >
    > >
    > > At the top of the form are various filtering options, including a quick
    > > search input box.
    > >
    > >
    > >
    > > If you set any filters, you need to click on the 'Filter' button to

    apply
    > > the filter. In that case the form posts back to the server and performs

    > the
    > > filter.
    > >
    > >
    > >
    > > But the quick search is designed to work easier/faster. If you type
    > > anything into that box, and press tab, it posts back to the server
    > > immediately and performs a search based on the text you entered.
    > >
    > >
    > >
    > > I achieve this by coding these attributes into the quick search textbox:
    > >
    > > AutoPostBack="True" OnTextChanged="QuickSearch"
    > >
    > >
    > >
    > >
    > >
    > > Everything works fine if the user types something and presses Tab.
    > >
    > >
    > >
    > > But, if the user types something into the quick search textbox, and

    > presses
    > > ENTER instead of TAB, then the form posts TWICE instead of once, and I

    > wind
    > > up duplicating data on the screen.
    > >
    > >
    > >
    > >
    > >
    > > Currently the @Page directive has AutoEventWireup="false"
    > >
    > >
    > >
    > > If I changed that to TRUE, it's even worse (it ALWAYS double posts).
    > >
    > >
    > >
    > >
    > >
    > > Any ideas?
    > >
    > >
    > >
    > >

    >
    >
    >
     
    Boban Dragojlovic, Feb 4, 2004
    #3
  4. The ENTER key in most browsers will submit a form by default. Your textbox
    has an event handler that is triggered when the textbox loses focus. When
    the form is submitted, the textbox loses focus, thereby triggereing 2
    "events".

    --
    HTH,
    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    Big things are made up
    of lots of little things.

    "Boban Dragojlovic" <news@_N_O_S_P_AM_dragojlovic.org> wrote in message
    news:wIdUb.21537$...
    > Can you explain to me what is happening...
    >
    > What do the two post events represent?
    >
    >
    >
    > "Kevin Spencer" <> wrote in message
    > news:...
    > > You'll have to write a JavaScript routine that captures the ENTER key

    and
    > > reacts appropriately.
    > >
    > > --
    > > HTH,
    > > Kevin Spencer
    > > .Net Developer
    > > Microsoft MVP
    > > Big things are made up
    > > of lots of little things.
    > >
    > > "Boban Dragojlovic" <news@_N_O_S_P_AM_dragojlovic.org> wrote in message
    > > news:AmdUb.21526$...
    > > > I have a webform that shows a long list of customers (500 - 1000) to

    the
    > > > user.
    > > >
    > > >
    > > >
    > > > At the top of the form are various filtering options, including a

    quick
    > > > search input box.
    > > >
    > > >
    > > >
    > > > If you set any filters, you need to click on the 'Filter' button to

    > apply
    > > > the filter. In that case the form posts back to the server and

    performs
    > > the
    > > > filter.
    > > >
    > > >
    > > >
    > > > But the quick search is designed to work easier/faster. If you type
    > > > anything into that box, and press tab, it posts back to the server
    > > > immediately and performs a search based on the text you entered.
    > > >
    > > >
    > > >
    > > > I achieve this by coding these attributes into the quick search

    textbox:
    > > >
    > > > AutoPostBack="True" OnTextChanged="QuickSearch"
    > > >
    > > >
    > > >
    > > >
    > > >
    > > > Everything works fine if the user types something and presses Tab.
    > > >
    > > >
    > > >
    > > > But, if the user types something into the quick search textbox, and

    > > presses
    > > > ENTER instead of TAB, then the form posts TWICE instead of once, and I

    > > wind
    > > > up duplicating data on the screen.
    > > >
    > > >
    > > >
    > > >
    > > >
    > > > Currently the @Page directive has AutoEventWireup="false"
    > > >
    > > >
    > > >
    > > > If I changed that to TRUE, it's even worse (it ALWAYS double posts).
    > > >
    > > >
    > > >
    > > >
    > > >
    > > > Any ideas?
    > > >
    > > >
    > > >
    > > >

    > >
    > >
    > >

    >
    >
     
    Kevin Spencer, Feb 4, 2004
    #4
  5. >
    > But the quick search is designed to work easier/faster. If you type
    > anything into that box, and press tab, it posts back to the server
    > immediately and performs a search based on the text you entered.
    >

    that's madness. that's not what the users will be expecting to happen, it
    will confuse them. don't do it.
     
    Rimu Atkinson, Feb 4, 2004
    #5
  6. Boban Dragojlovic

    Gibs Guest

    you have to catch the enter key. you can use this piece in the
    onsubmit="return false;" form tag.

    "Boban Dragojlovic" <news@_N_O_S_P_AM_dragojlovic.org> wrote in message
    news:AmdUb.21526$...
    > I have a webform that shows a long list of customers (500 - 1000) to the
    > user.
    >
    >
    >
    > At the top of the form are various filtering options, including a quick
    > search input box.
    >
    >
    >
    > If you set any filters, you need to click on the 'Filter' button to apply
    > the filter. In that case the form posts back to the server and performs

    the
    > filter.
    >
    >
    >
    > But the quick search is designed to work easier/faster. If you type
    > anything into that box, and press tab, it posts back to the server
    > immediately and performs a search based on the text you entered.
    >
    >
    >
    > I achieve this by coding these attributes into the quick search textbox:
    >
    > AutoPostBack="True" OnTextChanged="QuickSearch"
    >
    >
    >
    >
    >
    > Everything works fine if the user types something and presses Tab.
    >
    >
    >
    > But, if the user types something into the quick search textbox, and

    presses
    > ENTER instead of TAB, then the form posts TWICE instead of once, and I

    wind
    > up duplicating data on the screen.
    >
    >
    >
    >
    >
    > Currently the @Page directive has AutoEventWireup="false"
    >
    >
    >
    > If I changed that to TRUE, it's even worse (it ALWAYS double posts).
    >
    >
    >
    >
    >
    > Any ideas?
    >
    >
    >
    >
     
    Gibs, Feb 4, 2004
    #6
  7. If they add that to the form, it will never submit.

    --
    HTH,
    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    Big things are made up
    of lots of little things.

    "Gibs" <> wrote in message
    news:#...
    > you have to catch the enter key. you can use this piece in the
    > onsubmit="return false;" form tag.
    >
    > "Boban Dragojlovic" <news@_N_O_S_P_AM_dragojlovic.org> wrote in message
    > news:AmdUb.21526$...
    > > I have a webform that shows a long list of customers (500 - 1000) to the
    > > user.
    > >
    > >
    > >
    > > At the top of the form are various filtering options, including a quick
    > > search input box.
    > >
    > >
    > >
    > > If you set any filters, you need to click on the 'Filter' button to

    apply
    > > the filter. In that case the form posts back to the server and performs

    > the
    > > filter.
    > >
    > >
    > >
    > > But the quick search is designed to work easier/faster. If you type
    > > anything into that box, and press tab, it posts back to the server
    > > immediately and performs a search based on the text you entered.
    > >
    > >
    > >
    > > I achieve this by coding these attributes into the quick search textbox:
    > >
    > > AutoPostBack="True" OnTextChanged="QuickSearch"
    > >
    > >
    > >
    > >
    > >
    > > Everything works fine if the user types something and presses Tab.
    > >
    > >
    > >
    > > But, if the user types something into the quick search textbox, and

    > presses
    > > ENTER instead of TAB, then the form posts TWICE instead of once, and I

    > wind
    > > up duplicating data on the screen.
    > >
    > >
    > >
    > >
    > >
    > > Currently the @Page directive has AutoEventWireup="false"
    > >
    > >
    > >
    > > If I changed that to TRUE, it's even worse (it ALWAYS double posts).
    > >
    > >
    > >
    > >
    > >
    > > Any ideas?
    > >
    > >
    > >
    > >

    >
    >
     
    Kevin Spencer, Feb 5, 2004
    #7
    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. alanb
    Replies:
    2
    Views:
    574
    alanb
    Apr 23, 2004
  2. Guru

    jsp form double posting

    Guru, Nov 12, 2003, in forum: Java
    Replies:
    4
    Views:
    5,243
    Erwin Moller
    Nov 17, 2003
  3. Sydex
    Replies:
    12
    Views:
    6,646
    Victor Bazarov
    Feb 17, 2005
  4. AmitKu
    Replies:
    7
    Views:
    582
    John Timney \(MVP\)
    Jan 8, 2007
  5. Larry Martell

    Top posting and double spacing

    Larry Martell, Feb 12, 2014, in forum: Python
    Replies:
    3
    Views:
    40
    Sivaram Neelakantan
    Feb 13, 2014
Loading...

Share This Page