I have a log in page..Where in it contains username and password..Whenever i enter the values for username and Password and press TAB and then Press Enter it will go to next page..But my requirement is after entering the values and press Enter without Pressing Tab button it should go to next page..I am doing this code in asp.net with c#..
Username --------------- Password --------------- Lo-gin
Below specified is the aspx code
style="top: 198px; left: 561px; position: absolute; height: 22px; width: 128px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="Please enter the username" ControlToValidate="txtuser" Display="None" ValidationGroup="Validation" SetFocusOnError="true"></asp:RequiredFieldValidator>
<asp:TextBox
ID="txtpass" runat="server"
style="top: 239px; left: 561px; position: absolute; height: 22px; width: 128px"
TextMode="Password"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Please enter the password" ControlToValidate="txtpass" Display="None" ValidationGroup="Validation" SetFocusOnError="true"></asp:RequiredFieldValidator>
<asp:Label ID="Label1" runat="server" Text="Username"></asp:Label>
</p>
<p>
<asp:Button ID="Button1" runat="server" onclick="Button1_Click"
style="top: 289px; left: 512px; position: absolute; height: 30px; width: 76px"
Text="Login" ValidationGroup="Validation" BackColor="#993300" ForeColor="White" />
<asp:Label ID="Label2" runat="server" Text="Password"></asp:Label>
with C#
if (e.keyPress == 13)//Error..
{
if (Username == "admin")
{
Response.Redirect("~/Admin/admininfo.aspx");
}
else
{
Response.Redirect("~/Faculty/facultyinfo.aspx");
}
}
}
Need some help on this issue...The code should be written in c#..I am using VS 2010..