Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > RE: Enter in textbox causes bad postback

Reply
Thread Tools

RE: Enter in textbox causes bad postback

 
 
=?Utf-8?B?RGVtZXRyaQ==?=
Guest
Posts: n/a
 
      09-22-2004
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

 
Reply With Quote
 
 
 
 
=?Utf-8?B?VG9ueSBIZWRnZQ==?=
Guest
Posts: n/a
 
      09-22-2004
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to disable imagebutton postback when i enter "enter" =?Utf-8?B?am9l?= ASP .Net 0 09-28-2006 06:46 AM
capturing from text area Shft+Enter, Control+Enter, Alt+Enter and browser issue. HopfZ Javascript 0 08-28-2006 10:11 AM
Pressing <ENTER> in text input control causes a postback ! peshrad ASP .Net 4 08-26-2005 02:32 PM
Re: Enter in textbox causes bad postback vMike ASP .Net 1 09-22-2004 08:17 PM
Enter in textbox causes bad postback =?Utf-8?B?VG9ueSBIZWRnZQ==?= ASP .Net 0 09-22-2004 07:19 PM



Advertisments