Login Control -- Set Focus ?

Discussion in 'ASP .Net' started by Brad Isaacs, Jan 18, 2007.

  1. Brad Isaacs

    Brad Isaacs Guest

    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
    Brad Isaacs, Jan 18, 2007
    #1
    1. Advertising

  2. Brad Isaacs

    Brad Isaacs Guest

    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
    >
    >
    >
    Brad Isaacs, Jan 19, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jason
    Replies:
    4
    Views:
    1,595
    Jason
    May 7, 2007
  2. Paul
    Replies:
    2
    Views:
    386
  3. Mad Scientist Jr
    Replies:
    0
    Views:
    372
    Mad Scientist Jr
    Jul 13, 2004
  4. Replies:
    2
    Views:
    329
    Thomas 'PointedEars' Lahn
    Jun 6, 2005
  5. Roger
    Replies:
    3
    Views:
    310
Loading...

Share This Page