Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enter Key Event in ASP.NET WebForm to Perform Button Click [duplicate]

Tags:

c#

asp.net

I have a asp.net Textbox & Button in WebForm Page. When the enter key is pressed in textbox the button click should happen to load data to gridview on the page. Please suggest any sample code

like image 898
user1030181 Avatar asked Dec 17 '25 13:12

user1030181


1 Answers

Wrap that form in a panel, and make that button default button

<asp:Panel DefaultButton="button_id" runat="server">
your form here
</asp:Panel> 
like image 118
Vinay Pratap Singh Bhadauria Avatar answered Dec 20 '25 02:12

Vinay Pratap Singh Bhadauria



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!