help: keyDown on textBox?

H

hb

Hi,

I have an asp:textBox and an asp:button.
After user input data into textbox and hit "Enter" key, I want the event
behind the button to be executed.

Would you please tell me how I can do this?

Thank

hb
 
S

Steven Cheng[MSFT]

Hi Hb,

Thanks for posting in the community!
From your description, you'd like to implement the "default button"
function in ASP.NET web page. When user enters some data in textbox and
then press "enter" key, the submit button on the page will be fired ,yes?

This is a common question in newsgroup. Here is the google link of a former
post discussing on this issue:

#<enter> key and form submit
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=x8Tmqg83
DHA.1992%40cpmsftngxa07.phx.gbl&rnum=2&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3
DUTF-8%26oe%3DUTF-8%26q%3Ddefault%2Bbutton%2Bsteven%2Bcheng

Also, here are some good tech articles on "enter" key default button which
are mentioned in the above post, you can view them directly via the
following web links:

http://www.kamp-hansen.dk/pages/showdoc.asp?id=28&menuid=21&menuid=18

http://www.metabuilders.com/tools/DefaultButtons.aspx

http://www.allasp.net/enterkey.aspx

Hope these help.


Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top