Click here to Skip to main content
14,700,041 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Comments
_Amy 28-Feb-13 1:48am
   
What is the issue you are facing with panel?
Rockstar_ 28-Feb-13 1:48am
   
What is the actual problem dear?
Rockstar_ 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

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
   

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




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900