enter Key to submit a query

D

Dave

I have a web page with a text box and a query box that submits a query to a
database that fills a datagrid.

I want the enter key to submit the query - sof far I haven't found a method
to it.

When i hit enter - it looks like focus is on the datagrid.
 
S

Steven Cheng[MSFT]

Hi Dave,


Thanks for posting in the community!
From your description, you had some entry fields on a webpage and a button
to submit the web form. Now you'd like set the button as a default button
so that when the user press "enter" key and one of the entry fields is on
focus, the button's click event will be fired, yes?
If there is anything I misunderstood, please feel free to let me know.

As for this question, here are several tech articles discussing on setting
a default button( be fired when "enter" key press) on a asp.net web form:

#ASP.NET Default Button.Net
http://www.kamp-hansen.dk/pages/showdoc.asp?id=28&menuid=21&menuid=18

#Using the enter key to submit a form
http://www.allasp.net/enterkey.aspx

Also, here is one former post(the web link in google) which also contains
the solution to this problem:

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=x8Tmqg83
DHA.1992%40cpmsftngxa07.phx.gbl&rnum=1&prev=/groups%3Fhl%3Den%26lr%3D%26ie%3
DUTF-8%26oe%3DUTF-8%26q%3Dasp.net%2Bdefault%2Bbutton%2Bsteven%2Bcheng


Please check out the preceding items. If you have any questions, please
feel free to post here.




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

Top