Because of this It’s a login control. I didn’t control each text box separately through code in the way I am used to.
Does anyone happen to know how to focus on the control.
Steve
p>
p>
protected void Page_Load(object sender, EventArgs e)
{
string focus = "document.getElementById('" + Login1.ClientID + "_UserName').focus();";
// the following assumes that your login page's type is'Login'
// eg public partial class Login: Page ....
ClientScript.RegisterStartupScript(typeof(Login), "uidFocus ", focus, true);
}
I know this seems to be a very basic question, but I can’t figure out how to focus the text box On PageLoad.
Since this is a login control, I did not control each text box individually through code in the way I am used to.
Does anyone happen to know how Focus on control.
Steve
Adjust this to meet your requirements…
< p>
protected void Page_Load(object sender, EventArgs e)
{
string focus = "document.getElementById('" + Login1.ClientID + "_UserName').focus( );"; // the following assumes that your login page's type is'Login'
// eg public partial class Login: Page ....
ClientScript.RegisterStartupScript(typeof(Login), "uidFocus" , focus, true);
}