473,408 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

help: keyDown on textBox?

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
Nov 18 '05 #1
2 2084
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=e...readm=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/show...d=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

Nov 18 '05 #2
hb
Hi, Steven,

I got it work now. Thank you very much for your help!

hb
"Steven Cheng[MSFT]" <v-******@online.microsoft.com> wrote in message
news:KW**************@cpmsftngxa06.phx.gbl...
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=e...readm=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/show...d=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

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: ss78 | last post by:
I am having a problem trying to figure out how I can make my combobox function as you see the ones on the web . I am trying to make it so that if the user uses the keyboard and enters lets say "a"...
4
by: Anne | last post by:
hie again, i have 3 textbox and i would like the user to go to the next textbox by pressing the 'ENTER' key. i have tried using this: Private Sub txtRequestor_KeyDown(ByVal sender As...
16
by: Merlin | last post by:
I have created a users control with a text box and button on it, what I want to do is override the usercontrol Keydown events with that of the Text box. What is the correct syntax to accomplish...
3
by: Colin McGuire | last post by:
Hi, can I ask what I should be doing below. For some reason the method KeyDown doesn't exist in MyBase. Thank you Colin Private Sub TextBox1_KeyDown(ByVal sender As Object, _ ByVal e As...
8
by: Peter Proost | last post by:
Hi, this is my (simplified) situation: I have got 3 forms and one usercontrol: their names are: container (startup object),myform,another, mycontrol contair has got IsMdiContainer set to...
4
by: melanieab | last post by:
Hi, Sorry this is a long message, but I'm getting desperate (and worried). I have a textbox (say, tb1) where the string is longer than the width of the box. If I'm coming from the previous...
1
by: fripper | last post by:
I have a VB 2005 windows app and I want to recognize keydown events. I have a form key down event handler but it does not get control when a key is depressed. In playing around I found that if I...
2
by: Gidi | last post by:
Hi, I have a textBox, i want to add after each Keydown Event the char *, i did textbox1=textbox1.Text + "*"; but i can i send the coruser to the end of the line so the next letter will be...
1
by: rocksoft | last post by:
Hi, I am working in asp.net with C# web application, i have used one textbox and image button for search funtion, i have created one user control for this, but after i have entered...
2
by: Tony Johansson | last post by:
Hello! I have created a Control that consist of a label and a textbox.I have called this class ctlLabelTextbox. public partial class ctlLabelTextbox : UserControl { .... } The class that I...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.