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

  • SEARCH
  • Home
  • 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 8114357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:07:22+00:00 2026-06-06T03:07:22+00:00

I have almost the exact same question as at the following post (and I

  • 0

I have almost the exact same question as at the following post (and I tried both of the answers, but neither works), except I’m not worried about whether the TabContainer is last on the page or not – I want to prevent the page from skipping up or down to any tabcontainer when the updatePanel containing the tabcontainer gets updated. (Of course, I guess it’s actually a TabPanel – the active one – getting the focus, not really the TabContainer.)

AjaxToolkit: the last TabContainer on the page is focused on page load

As the poster says at above link, I have not explicitly set any focus, so I don’t know why focus is getting set to my tabPanel. When I debug, I can see that there is some javascript loaded by Ajax that sets focus.

I guess what I want to do, unless there is some property I can set (autofocus=false ?) is override whatever ajax javascript is being executed so that the focus does not get set.

Not sure how to go about this, however. Is that javascript source published somewhere, so I can copy it, comment out the focus instruction, and override?

UPDATE

I was debugging the release version of the ajax script. I didn’t realize there was a debug version available. I had debugging on in web.config, but apparently the ScriptManager also needs ScriptMode=”Debug”; when I set that, I get debug versions of internal ajax code. I’m not done yet, but I think should now be able to find the offensive code that sets the focus without me asking it to set any focus, and override it. I’ll post an answer when I’m done.

  • 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-06T03:07:24+00:00Added an answer on June 6, 2026 at 3:07 am

    Finally fixed it myself by debugging ajax, finding the offensive code and overriding it.

    If anyone has the same problem, this is AjaxCotnrolToolkit version 4.1.60501.0, and the below resides in Tabs.Tabs.js; just stick this script on your page to stop the annoying autofocus.

    I’ve turned it off altogether for now, but of course it could be turned off conditionally if that’s what you want.

    The only difference between the below and the original method is the commented line.

        Sys.Extended.UI.TabContainer.prototype._app_onload = function (sender, e) {
                if (this._cachedActiveTabIndex != -1) {
                    this.set_activeTabIndex(this._cachedActiveTabIndex);
                    this._cachedActiveTabIndex = -1;
    
                    var activeTab = this.get_tabs()[this._activeTabIndex];
                    if (activeTab) {
                        activeTab._wasLoaded = true;
                        //activeTab._setFocus(activeTab);     // the only change made to this prototype
                    }
                }
                this._loaded = true;
            }
    

    EDIT: Wow, I just noticed this is exactly the same code as was provided at the original link I posted above. I guess I must have made some stupid mistake before that prevented it from working for me.

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

Sidebar

Related Questions

I asked Almost this exact same question yesterday. Basically I have a css button
I have tried almost all the solutions from SO but no success :(. I
I have two tables which get updated at almost the exact same time -
in my database i have 10 records with almost exact same data , they
I have almost the same problem as this unanswered question . The only difference
I have almost created a website that works in all major browsers flawlessly. Yesterday,
So I have this stinky method, the two conditional blocks do almost the exact
As I can't post code I'm asking this as a theoretical question, but giving
( Almost exact duplicate of Keeping original format POST passing through AWK submitted by
Anyone any idea why on 2 different PC's who have the exact same workspace

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.