Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Login Control -- Set Focus ?

Reply
Thread Tools

Login Control -- Set Focus ?

 
 
Brad Isaacs
Guest
Posts: n/a
 
      01-18-2007
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



 
Reply With Quote
 
 
 
 
Brad Isaacs
Guest
Posts: n/a
 
      01-19-2007
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


"Brad Isaacs" <> wrote in message
news:%23q$...
> 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
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Set focus on control 2 with click event of control 1 Paul ASP .Net 2 07-08-2008 07:58 PM
emulating window.focus in Body onload() event and setting focus to a control on same page Jason ASP .Net 4 05-07-2007 05:54 PM
this.window.focus() vs. window.focus() vs. this.focus() Roger Javascript 3 03-08-2007 08:53 PM
Why does putting focus on textbox also set focus to submit jw56578@gmail.com Javascript 2 06-06-2005 08:20 PM
unable to set focus to control after validation (must tab twice to exit control) Mad Scientist Jr ASP .Net Web Controls 0 07-13-2004 08:01 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57