TEXTBOX HELP!!!
-
Hi All, I am trying to do the following in a web control that I am creating: I have a username and password textboxes and a login button. when the user is in the password textbox and if they hit I want either one of the following two behaviours to happen: 1. do nothing, or 2. automatically fire the login button's clicked postback event Right now when a user hits it loses focus from the textbox and does nothing! (If it is doing a postback then what event is it firing!!!) This is driving me crazy! any help would be greatly appreciated! schoudhr@hotmail.com
-
Hi All, I am trying to do the following in a web control that I am creating: I have a username and password textboxes and a login button. when the user is in the password textbox and if they hit I want either one of the following two behaviours to happen: 1. do nothing, or 2. automatically fire the login button's clicked postback event Right now when a user hits it loses focus from the textbox and does nothing! (If it is doing a postback then what event is it firing!!!) This is driving me crazy! any help would be greatly appreciated! schoudhr@hotmail.com
Hi All, I am trying to do the following in a web control that I am creating: I have a username and password textboxes and a login button. when the user is in the password textbox and if they hit "ENTER" I want either one of the following two behaviours to happen: 1. do nothing BUT don't lose focus on the textbox either!, or 2. automatically fire the login button's clicked postback event (#2 is preferable) Right now when a user hits "ENTER" it loses focus from the textbox and does nothing! (If it is doing a postback then what event is it firing!!!) This is driving me crazy! any help would be greatly appreciated! schoudhr@hotmail.com
-
Hi All, I am trying to do the following in a web control that I am creating: I have a username and password textboxes and a login button. when the user is in the password textbox and if they hit "ENTER" I want either one of the following two behaviours to happen: 1. do nothing BUT don't lose focus on the textbox either!, or 2. automatically fire the login button's clicked postback event (#2 is preferable) Right now when a user hits "ENTER" it loses focus from the textbox and does nothing! (If it is doing a postback then what event is it firing!!!) This is driving me crazy! any help would be greatly appreciated! schoudhr@hotmail.com
If you are talking about a C# Windows application then here's an idea, may give you a place to start.
// In your InitializeComponent() method, make sure you've set the event
// Set the event to catch a keypress from your Password textbox
this.txtPassword.KeyPress +=
new System.Windows.Forms.KeyPressEventHandler(this.txtPassword_KeyPress);.....
// The Event Handler
private void Generic_KeyPress(object sender,
System.Windows.Forms.KeyPressEventArgs e)
{
// When the "Enter" key is pressed, fire your button click event
// using appropriate arguments, EventArgs.Empty, or null
if(e.KeyChar == (char)13)
cmdLogin_ButtonClick(this, EventArgs.Empty);
}