Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8894919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:37:58+00:00 2026-06-14T23:37:58+00:00

I a have a web form with few textboxes,dropdowns and finally towards the end

  • 0

I a have a web form with few textboxes,dropdowns and finally towards the end of the page is 4 custom ajax editors. So on page load the focus is always inside the last editor and no way it comes to the first text box or top of page.On each page load the cursor goes inside the last editor control.How to bring the focus inside the first text box?
Below are the few methods i tried

1.<body onload="document.body.scrollTop = 0;">

2.    void Page_Init(object sender, EventArgs e)
{

    SetFocus(txtReqtitle);


}

for the above while loading the page i could see the focus goes to the desired text box and then it comes to the last custom control.

3.    if(!Page.ClientScript.IsStartupScriptRegistered("scrFocus"))
           {
              string strScript="var txtBox=document.getElementById('" + txtReqtitle.ClientID.ToString() +"');txtBox.focus();";
               ClientScript.RegisterStartupScript(this.GetType(),"scrFocus", strScript,true);


            }

4.

function setFocus() {
document.getElementById("txtReqtitle").focus();

}

5. ScriptManager.GetCurrent(this.Page).SetFocus(txtReqtitle);

Any ideas? Thanks..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T23:38:00+00:00Added an answer on June 14, 2026 at 11:38 pm

    found the solution which worked for me .would like to share it .. its simple ..just make the autofocus=false for the control.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have few controls on asp.net web form page and i want to link
Im implementing Web Form using ASP.NET in c#, I have a page with few
I have a web form with some TextBoxes and CheckBoxList . I want to
I have a web form and i want to call Asynchronously Ajax.ActionLink(). Please help
I have web form with a GridView and a few controls in the GridView.
I have a new MVC3 application with a few legacy Web Form pages. I'm
I have a web page which has a form at the top and a
I have a web page that has a few text boxes, and a dual
I have web form with a panel which has form elements in side it.
I am running a thread in C#. I have web form. I declared public

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.