Results 1 to 2 of 2

Thread: Initial focus

  1. #1

    Thread Starter
    Member Ooogaleee's Avatar
    Join Date
    Nov 2002
    Location
    Jacksonville, FL
    Posts
    52

    Question Initial focus

    Ok, VB-freaks...I'm sure this is an easy question to answer, but I've had no luck...

    How does one set the initial focus on a web form? I tried SetInitialFocus(txtTextBox1), but it just advises me it's not declared. I tried to set the TabIndex, but no go there either...

    hmmmm....Ooogs

  2. #2
    C# Aficionado Lord_Rat's Avatar
    Join Date
    Sep 2001
    Location
    Cave
    Posts
    2,497
    Page.Controls.Add(new LiteralControl("<script Language=""JavaScript"">" & FindControl("ControlName").ID & ".focus();</Script>"))

    You might have to play around with it a little.
    Need to re-register ASP.NET?
    C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i

    (Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width