Advertisement

05.20.2008 at 07:19AM PDT, ID: 23417238
[x]
Attachment Details

How to fire a button click event on hitting enter key

Asked by anjana_i in Active Server Pages (ASP), JavaScript, C# Programming Language

Tags: microsoft, 2000, java script,c# asp

I have a button  on a page which is associated with a text box. After entering the data in the text box.. I would like to fire the button click event as Submit even also when we hit enter. How can i implement this functionality.

The page load, button click and the text box code is given below


If i need to add any javascript code also do let me know the syntax in detail.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
private void btnSearch_Click(object sender, EventArgs e)
		{
			Logger.SearchInstance.Debug(txtCustomer.Text);
			RunSearch();
		}
 
 
private void Page_Load(object sender, EventArgs e)
		{
			if (!Page.IsPostBack)
			{
				BindData();
 
				
				if (HasSearchTerms())
				{
					LoadForm();
					RunSearch();
				}
 
			}
[+][-]05.20.2008 at 08:08AM PDT, ID: 21606869

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.20.2008 at 08:10AM PDT, ID: 21606889

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Active Server Pages (ASP), JavaScript, C# Programming Language
Tags: microsoft, 2000, java script,c# asp
Sign Up Now!
Solution Provided By: coldboy
Participating Experts: 3
Solution Grade: A
 
 
[+][-]05.20.2008 at 08:10AM PDT, ID: 21606895

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628