Login Control -- Set Focus ?

B

Brad Isaacs

Good evening friends,

I am working with Visual Studio 2005, ASP.NET 2.0

I am working with the Login controls provided my .NET 2.0, trying to make
the Login1 control UserName textbox obtain SetFocus upon load of the .aspx
web page but I cannot for the life of me get this to work. It loads and the
Focus is not working.

I have tried the following:

<asp:Content ID="Content1" runat="server"
ContentPlaceHolderID="ContentPlaceHolder1">
<br />
<br />
<form runat=server id="aspLoginForm">
<script language='JavaScript' type="text/javascript">
<!--
function SetFocus()
{
//This is not working.......???
document.aspLoginForm['Login1_UserName'].focus();
}
window.onload = SetFocus;
// -->
</script>
<div>
<br />
<br />
<br />
&nbsp;</div>
<br />
<br />
<br />
<br />
<br />
<asp:Login ID="Login1" runat="server"


Any ideas would be greatly apprecited.

Thanks in advance,

~Brad
 
B

Brad Isaacs

Dear freinds,

I am searching with Google and still cannot find anything that will work.

I tried this and it still does not see it :::
form runat=server id="aspLoginForm" defaultfocus="Login1_UserName">

Any ideas would be greatly apprecited.
Thanks in advance,

~Brad
 

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

Top