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 5994993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:53:51+00:00 2026-05-22T23:53:51+00:00

I have encountered a slightly bizarre bug while using the ajax control toolkit TabPanel.

  • 0

I have encountered a slightly bizarre bug while using the ajax control toolkit TabPanel. I have 4 tabs in row like so:

[Tab1][Tab2][Tab3][Tab4]

Now tab 2 should only appear in certain circumstances, and so has its visibility set to false. However while it is invisible, if I was to click on Tab 3, it would load the tab before switching to Tab 1. Similarly selecting tab4 will load tab4 but then immediately switch to tab3. On the server side the ActiveTabChanged event is being hit twice, once for the tab correctly selected, on once for the tab it is switching too.

If I move Tab2 to the end of the row of tabs, everything works fine. Having read up on the toolkit a bit, I presume this is an error to do with the active tab index, and the javascript is setting it to one lower than it should, but I’m not sure how to going about fixing it.

  • 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-05-22T23:53:52+00:00Added an answer on May 22, 2026 at 11:53 pm

    I’m not sure if this is the same issue but it sounds similar to one that i’ve had for few months. Have a look here for my problem and the solution:

    • forums.asp.net: hiding TabContainer TabPanels

    I had to fix a Bug in Ajax-Toolkit from PreRender:

    Private Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
        'ensure that the Tabs stay invisible that have Visible=False on markup and dont get visible programmatically'  
        Me.TabThatShouldStayInvisible.Visible = False
        FixTabPanelVisible(TabContainer1)
    End Sub
    
    Protected Sub FixTabPanelVisible(ByVal tabcontainer As AjaxControlToolkit.TabContainer)
        For Each tp As AjaxControlToolkit.TabPanel In tabcontainer.Tabs
            Dim oldVisible As Boolean = CBool(IIf(IsNothing(ViewState(tp.UniqueID + "_Display")), True, ViewState(tp.UniqueID + "_Display")))
            If Not tp.Visible Then
                ViewState(tp.UniqueID + "_Display") = False
                DisableTab(tabcontainer, tabcontainer.Tabs.IndexOf(tp))
            ElseIf tp.Visible AndAlso Not oldVisible Then
                ViewState(tp.UniqueID + "_Display") = True
                EnableTab(tabcontainer, tabcontainer.Tabs.IndexOf(tp))
            End If
            tp.Visible = True
        Next
        Dim fixScript As New StringBuilder()
        fixScript.Append("function DisableTab(container, index) {$get(container.get_tabs()[index].get_id() + ""_tab"").style.display = ""none"";}")
        fixScript.Append("function EnableTab(container, index) {$get(container.get_tabs()[index].get_id() + ""_tab"").style.display = """";}")
        ScriptManager.RegisterStartupScript(Me, Me.GetType(), "FixScriptReg", fixScript.ToString(), True)
    End Sub
    
    Protected Sub EnableTab(ByVal container As AjaxControlToolkit.TabContainer, ByVal index As Integer)
        Dim sFunction As String = "function () {EnableTab($find('" & container.ClientID & "')," & index & ");}"
        ScriptManager.RegisterStartupScript(Me, Me.GetType(), "EnableTabFun" & index, "Sys.Application.add_load(" & sFunction & ");", True)
    End Sub
    
    Protected Sub DisableTab(ByVal container As AjaxControlToolkit.TabContainer, ByVal index As Integer)
        Dim sFunction As String = "function () {DisableTab($find('" & container.ClientID & "')," & index & ");}"
        ScriptManager.RegisterStartupScript(Me, Me.GetType(), "DisableTabFun" & index, "Sys.Application.add_load(" & sFunction & ");", True)
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have encountered a unique problem. I am doing a simple ajax call using
I have a snippet to create a 'Like' button for our news site: <iframe
I have encountered a problem I believe to be related to what's stated in
This is the weirdest behaviour I have encountered in default set of controls/helpers in
Many of you probably encountered this situation. For example you have a jQuery fade
I have a project that adds elements to an AutoCad drawing. I noticed that
I have a script that appends some rows to a table. One of the
I have a new web app that is packaged as a WAR as part
I have several USB mass storage flash drives connected to a Ubuntu Linux computer
I have found this example on StackOverflow: var people = new List<Person> { new

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.