Hi fellow programmers,
How do i login without clicking the login button after pressing the enter key on the keyboard in asp.net. after entering login details?
scenario: a user enters username and password,after entering password when he/she presses enter on the the keyboard, he/she must be logged in without physically clicking the login button.
Loading

Satyapriya NayakPosted Sep 24, 2011, 2:00 AM
@Sam has explained it beautifully.
Also
Refer the below link
http://www.beansoftware.com/ASP.NET-Tutorials/Accept-Enter-Key.aspx
Thanks
If this post helps you mark it as answer
Sam HobbsPosted Sep 23, 2011, 7:41 PM
event.srcElement.focus();// This might not be necessary
switch (event.keyCode) {
case 13:
// do the same as is done in the OnClick of the button
break;
}
}
Note that you can use an if statement instead of a switch statement but if you want to check for other keys then the switch statement would be better.
Andile ChokoPosted Sep 23, 2011, 5:58 PM
Sam HobbsPosted Sep 23, 2011, 5:23 PM