I have a page with an updatepanel which contains a small login form – it runs fine when the user clicks on the submit button, but if the user presses the return key after entering their password, it does not run.
Here’s the code…
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="loginButton" EventName="Click" />
</Triggers>
<ContentTemplate>
<asp:TextBox ID="username" MaxLength="11" runat="server" />
<asp:TextBox ID="password" MaxLength="64" runat="server" TextMode="Password" />
<asp:LinkButton ID="loginButton" OnClick="Submit_login" runat="server" Text="<img src='login.png' alt='Login' />" />
</ContentTemplate>
</asp:UpdatePanel>
If you add a panel in the Content template and assign the
DefaultButton, it should submit the button when a user hits Enter.