A ad Sep 21, 2005 #1 I use a LoginView to authenticate user. Can we set the focus in the UserName or Password of the LoginView?
I use a LoginView to authenticate user. Can we set the focus in the UserName or Password of the LoginView?
N needin4mation Sep 21, 2005 #2 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); }
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); }
J Juan T. Llibre Sep 21, 2005 #3 See : http://ryanfarley.com/blog/archive/2004/12/21/1325.aspx Juan T. Llibre, ASP.NET MVP ASP.NET FAQ : http://asp.net.do/faq/ Foros de ASP.NET en Español : http://asp.net.do/foros/ ======================================
See : http://ryanfarley.com/blog/archive/2004/12/21/1325.aspx Juan T. Llibre, ASP.NET MVP ASP.NET FAQ : http://asp.net.do/faq/ Foros de ASP.NET en Español : http://asp.net.do/foros/ ======================================
A ad Sep 21, 2005 #4 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?
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?