Hi ,

 If you want to raise the click event of a button by press enter key on a textbox in your asp.net form. you can easily add a <asp:panel> on your page and set the defaultButton property of it to your button. for example see below code :

<asp:Panel ID="pnlSearch" runat="server" DefaultButton="btnSearch">

<table width="100%">

<tr>

<td><asp:TextBox ID="txtSearch" runat="server" Width="128px"></asp:TextBox>

</td>

<td>

<asp:ImageButton ID="btnSearch" runat="server" ImageUrl="~/images/search.png" /></td>

</tr>

</table>

</asp:Panel>

Currently rated 1.0 by 1 people

  • Currently 1/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5