Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > 2 buttons but want enter key in textbox to execute one buttons' click event?

Thread Tools

2 buttons but want enter key in textbox to execute one buttons' click event?

Posts: n/a
I would like to have the click event of one of two buttons to happen when a
person hits the enter key in a textbox on my aspx form.

Is this possible, or do I need to only have one button on the form?



Reply With Quote
Posts: n/a
This should work....

I used that code as a static method so I can reference it like

MyCommonWebCode.SetDefaultButton(Page, this.txtTextControl,

There might be an easier way but I don't know. Good luck!

Reply With Quote

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
Want <asp:textbox> to postback only when Enter key is pressed =?Utf-8?B?Sm9l?= ASP .Net 11 10-21-2005 11:43 AM
Enter Key H*ll, control enter key submit button BrianDH ASP .Net Web Controls 3 01-12-2005 08:29 PM
Help:How to avoid button click event when Enter key is press in a TextBox? Jie ASP .Net 7 10-09-2004 02:12 PM
Replace Tab Key to Return Key (Enter Key) from Web Forms? M P ASP General 1 08-06-2004 08:32 AM
Pressing Enter Key from a Textbox (Netscape 4.79) and simulate a button-click GOKU24 Javascript 0 08-26-2003 07:36 PM