Can we set focus in UserName of a LoginView

  • Thread starter Thread starter ad
  • Start date Start date
A

ad

I use a LoginView to authenticate user.
Can we set the focus in the UserName or Password of the LoginView?
 
here is one I found and modified it for csharp:

private void SetFocusControl(String ControlName)
{
//http://www.developer.com/net/asp/article.php/2237431
//character 34 = "

String script = "<script language=\"javascript\""+
">" +
" var control = document.getElementById(\"" +
ControlName + "\");" +
" if( control != null ){control.focus();}" +
"</script>";

Page.RegisterStartupScript("Focus", script);
}
 
Thanks,
If the UserName control is general textbox, It can do by SetFocus or
Javascript.
But now the UserName is in LoginView.
How can I do?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top