I was trying all sorts of things to set the focus to the UserName control of the ChangePassword Control, turns out it was as simple as:
if (!Page.IsPostBack)
ChangePasswordControl.Focus();
works for the Login Control too
if (!Page.IsPostBack)
LoginControl.Focus();
Monday, December 18, 2006
Subscribe to:
Post Comments (Atom)
2 comments:
How odd, you are totally right. I'm wondering why I'm always using code like this?
TextBox userName = Login1.FindControl("UserName") as TextBox;
if (userName != null) Page.SetFocus(userName);
that's exactly what I was trying to do =oS, shame on us
Post a Comment