RE: Enter in textbox causes bad postback

Discussion in 'ASP .Net' started by =?Utf-8?B?RGVtZXRyaQ==?=, Sep 22, 2004.

  1. How do you know that the click event for the button is what fires? Perhaps it
    is the SelectCommand of the grid that fires since the row has focus?


    "Tony Hedge" wrote:

    > Hello,
    > I can briefly explain without providing any code, it's a simple NET 1.1 web
    > project.
    >
    > I have a web form with a textbox A and button A (in a table row), and
    > textbox B and button B (in a second table row). The textboxes are of type
    > asp:Textbox and buttons are asp:Button. Autopostback=false for textboxes.
    > Click event used for the buttons.
    >
    > When user types in text in textbox B and hits Enter, the click event for
    > button A fires!!! Why, what is causing this to happen? I would like some
    > way to make button B fire instead, so I set the tabindex attributes on each
    > of the 4 controls above to try and provide that functionality but it didn't
    > work. the event for button A always fires when I ht enter.
    >
    > When I added textbox C and button C, etc... the same darn thing!!! How can
    > I at least turn off this behavior so that when Enter is hit no postback
    > occurs? I set autopostback to false for the textboxes but this didn't do
    > anything.
    >
    > Thanks in advance- Hedge
    =?Utf-8?B?RGVtZXRyaQ==?=, Sep 22, 2004
    #1
    1. Advertising

  2. Demetri,

    There is no grid, just an html table containing the textboxes and buttons to
    control there positioning.

    I haev a breakpoint in the button click events - it is 100% certain that the
    button A click event fires when enter key is hit in textbox B (or C, D,
    etc...)


    "Demetri" wrote:

    > How do you know that the click event for the button is what fires? Perhaps it
    > is the SelectCommand of the grid that fires since the row has focus?
    >
    >
    > "Tony Hedge" wrote:
    >
    > > Hello,
    > > I can briefly explain without providing any code, it's a simple NET 1.1 web
    > > project.
    > >
    > > I have a web form with a textbox A and button A (in a table row), and
    > > textbox B and button B (in a second table row). The textboxes are of type
    > > asp:Textbox and buttons are asp:Button. Autopostback=false for textboxes.
    > > Click event used for the buttons.
    > >
    > > When user types in text in textbox B and hits Enter, the click event for
    > > button A fires!!! Why, what is causing this to happen? I would like some
    > > way to make button B fire instead, so I set the tabindex attributes on each
    > > of the 4 controls above to try and provide that functionality but it didn't
    > > work. the event for button A always fires when I ht enter.
    > >
    > > When I added textbox C and button C, etc... the same darn thing!!! How can
    > > I at least turn off this behavior so that when Enter is hit no postback
    > > occurs? I set autopostback to false for the textboxes but this didn't do
    > > anything.
    > >
    > > Thanks in advance- Hedge
    =?Utf-8?B?VG9ueSBIZWRnZQ==?=, Sep 22, 2004
    #2
    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. Xavier Osa
    Replies:
    0
    Views:
    618
    Xavier Osa
    Jan 9, 2004
  2. vMike
    Replies:
    1
    Views:
    555
    =?Utf-8?B?VG9ueSBIZWRnZQ==?=
    Sep 22, 2004
  3. =?Utf-8?B?VG9ueSBIZWRnZQ==?=

    Enter in textbox causes bad postback

    =?Utf-8?B?VG9ueSBIZWRnZQ==?=, Sep 22, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    370
    =?Utf-8?B?VG9ueSBIZWRnZQ==?=
    Sep 22, 2004
  4. rantingrick
    Replies:
    44
    Views:
    1,165
    Peter Pearson
    Jul 13, 2010
  5. HopfZ
    Replies:
    0
    Views:
    537
    HopfZ
    Aug 28, 2006
Loading...

Share This Page