CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 3 of 3

Thread: TaxtBox Focus

  1. #1
    Join Date
    Jul 2001

    TaxtBox Focus

    I am using to create ASP web applicaiton form. please tell me how i can put my cursor in the TextBox1 when first my web page loads in browser.

    Kindly tell me if you have any link for free step by step beginer e-book for ASP and

    Thank you.

  2. #2
    Join Date
    Jun 2004
    Kashmir, India

    Re: TaxtBox Focus

    You will have to use Client javascript to do that
    Page.RegisterStartupScript("setFocus", "<script>document.getElementById('" & TextBox1.ClientID & "').focus();</script>")
    Take a look at RegisterStartupScript Method of the Page Object to understand what happens when you call this method.

  3. #3
    Join Date
    Apr 2000
    Washington (state)

    Re: TaxtBox Focus

    Used this in C# too... it worked perfectly!

    Page.RegisterStartupScript("setFocus", "<script>document.getElementById('" + Textbox1.ClientID + "').focus();</script>");

Posting Permissions

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

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)