I have inherited an ASP.NET 1.1 web application.
On the page there are various buttons, textboxes and other controls. There is also a password textbox and password button. If the user types in the password and presses the enter key (while the focus is in the textbox) then I need it to kick off the code behind’s
btnPassword click event handler.
When clicking on the password button with the mouse an error message is displayed if the password is invalid. This is correct. If I click enter while the focus is on the password textbox then I get a different result. It does go on the
btnPassword click event handler, but then it looks like as if the page resets itself and looks like when the page first loaded up.
Here is my markup:
<INPUT id="txtPassword" runat="server" type="password" NAME="txtPassword" onkeypress="kPress(event, 'btnPassword');"> <asp:button id="btnPassword" runat="server" Text="OK" CssClass="buttonDefault"></asp:button>