Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: 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 at 28-Feb-13 1:48am
   
What is the issue you are facing with panel?
Vijaychauhan0806 at 28-Feb-13 1:48am
   
What is the actual problem dear?
Vijaychauhan0806 at 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 at 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
0 OriginalGriff 250
1 Sergey Alexandrovich Kryukov 184
2 Rob Philpott 100
3 jlopez788 74
4 CHill60 70
0 OriginalGriff 6,837
1 Sergey Alexandrovich Kryukov 5,589
2 Maciej Los 3,479
3 Peter Leow 3,323
4 DamithSL 2,505


Advertise | Privacy | Mobile
Web04 | 2.8.140721.1 | Last Updated 28 Feb 2013
Copyright © CodeProject, 1999-2014
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