I have an asp web page(login.aspx) that uses a master page (master.page).
I need to set focus to an asp:textbox(TextBox1)
that is inside an asp:Panel(Panel1)
on Login.aspx
I want to set focus to TextBox1
on an asp:Button
click event (or page load on login.aspx for testing, I've tried both).
I have tried the following solutions with no success:
- Page.SetFocus(TextBox1.ClientID);
- Page.SetFocus(TextBox1);
- Page.SetFocus(TextBox1.ClientID)
- TextBox1.Focus();
- TextBox Test = (TextBox)Panel1.FindControl("TextBox1");
- Test.Focus();