This is based on a project using a ASP.NET Web Forms search page with a textbox txtSearchID and a search button btnSearch. The request was to make the submit button enabled by default when a user pressed on the ENTER key.
<asp:TextBox ID="txtSearchID" runat="server" MaxLength="10" /> <asp:Button ID="btnSearch" runat="server" Text="Search" />
The quickest solution is by adding a jQuery snippet at the end of the HTML doc, just before the closing </body> tag:
<script> $(document).keypress(function(e) { if (e.keyCode === 13) { $("#<%= btnSearch.ClientID %>").click(); return false; } }); </script>