Click here to Skip to main content
12,295,791 members (51,603 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# ASP.NET C#4.0
Hi,
I need to fire the Button click event when the user press enter key in the textbox using c# coding. I have used masterpage so there is no form tag. I tried using panel but there are some issues with that..help me..
Posted 27-Feb-13 19:44pm
Comments
_Amy 28-Feb-13 1:48am
   
What is the issue you are facing with panel?
Vijaychauhan0806 28-Feb-13 1:48am
   
What is the actual problem dear?
Vijaychauhan0806 28-Feb-13 1:49am
   
Just select the control and go to properties window and then double click on click event .Then write ur code in that block.
vasanth90 28-Feb-13 1:58am
   
@Amy:the problem in panel is....on pressing the enter button the search happens once and the focus is again on the textbox.. but its not editable ..we have to click on textbox twice then only can change content

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Take all your page contains in a panel and set DefaultButton property to your submit button.
<asp:panel runat="server" id="pnlSrchQuote" defaultbutton="btnSearch" xmlns:asp="#unknown">
     <!--My Controls here-->
</asp:panel>

--Amit
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160525.2 | Last Updated 28 Feb 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100