function runScript(e) { if (e.keyCode == 13) { GetUserLoginMethod(); return false; } }
<input type="text" runat="server" onkeypress="return runScript(event)" id="txtPassword" />
private void textBox1_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e) { if (e.KeyValue == 13) { //form.show() } }
private void txt_pwd_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { btn_login_Click(sender, e); // if u have a login button then call its on click event function here or else write your code for login here } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)