Link to home
Start Free TrialLog in
Avatar of TrialUser
TrialUserFlag for Afghanistan

asked on

enter key to trigger submit button in asp.net web [age

In my asp.net web application in the master page, I have a textbox and a button. when the user enters a text in the textbox and hits on the enter key, i would like for the button click to be triggered, i.e submit the form. how can i achieve that. please suggest. thx
Avatar of jppinto
jppinto
Flag of Portugal image

Please take a look at this tutorial:

http://www.beansoftware.com/ASP.NET-Tutorials/Accept-Enter-Key.aspx

jppinto
ASKER CERTIFIED SOLUTION
Avatar of Pra4444
Pra4444
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of NileshThakkar
NileshThakkar

Hi,

You can place button in <asp:Panel> and set panel's default button property as shown in below example:

<asp:panel defaultbutton="button2" runat="server">
        <asp:textbox id="textbox3" runat="server"/>
        <asp:button id="button2" runat="server"/>
    </asp:panel>

Vote this answer if it helps you.
Avatar of TrialUser

ASKER

thx