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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:53:05+00:00 2026-05-12T15:53:05+00:00

I have been going crazy over a problem with my tab control. It has

  • 0

I have been going crazy over a problem with my tab control.

It has to do with something messing up during ajax requests in ASP.NET and it’s driving me crazy because I think I’ve gone through at least 50 different possible solutions to try to fix this problem.

Let me explain. I have a Tab control (a TabStrip). Its simply a table (generated with a Repeater control) that has one row and each column (each td element) is a “tab”. Whenever a tab is clicked a corresponding div (Panel) is displayed.

This works, the corresponding div is displayed because I’m setting the div’s style property to display:block.

The problem I’m having has to do with the styles applied to the td elements. There are 2 styles, one that indicates that the tab is selected, and the other is to indicate that the tab is not selected.

So when this user selects a tab, the corresponding div is displayed and the JavaScript function loops through the tds in the TabStrip and applies the “unselected” style to all of the tabs except the currently selected tab, in which case the “selected” style is applied.

This works awesome unless an Ajax request has ever occurred on the page.

For some crazy reason the css classes are no longer available to the JavaScript that controls the tabs. The tabs work (as in they display the corresponding divs) when clicked on except the styles are not applied to the tabs any more.

I’ve tried just about everything to get around this. I even created a JavaScript function that dynamically adds the link to the style sheet with the tab’s styles in it to ensure that the style sheet was being loaded even during Ajax requests.

This did not help and I’m now considering a completely different approach but I have no idea how I’m going to do this.

What I want to do is set the style property of the tds instead of setting the className property.

The styles are stored in the external style sheet and I would like to keep them there so that I can easily change the style of the TabStrip using the style sheet whenever I want to without having to edit server code.

So…how do you get the style out of the styleSheet to parse it and apply the appropriate style properties to the element?

Do you have any other recommendations…because this idea seems to be quite difficult and at this point I’m wondering if I’m over looking some much simpler solution to this ugly problem.

Thanks for your help,

-Frinny

  • 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-12T15:53:05+00:00Added an answer on May 12, 2026 at 3:53 pm

    I found the answer to the problem.

    It had nothing to do with the style sheet. It ended up being a problem with the way I was registering the JavaScript arrays used for tabbing purposes in my .NET code with the ScriptManager.

    It’s long and complicated for me to explain so I’ll just sum it up to this note:

    The ScriptManager.RegisterArrayDeclaration() method will add elements to any already existing array…if the array doesn’t exist it’ll create one and then add elements to it. You should only call this function if you need to insert new elements into the array.

    My problem was that the arrays used for tabbing purposes were doubling every time an asynchronous postback occurred. This meant that the tabbing JavaScript would select the appropriate tab and then deselect it when the value was found again in the array.

    I got around my problem by using the Page.ClientScript.RegisterArrayDeclaration() method instead. This doesn’t have the same behaviour.

    Thanks for your time!

    -Frinny

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

Sidebar

Ask A Question

Stats

  • Questions 192k
  • Answers 192k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer public IQueryable<T> FindAll<T>() { var baseType = typeof(T); return CreateQuery<T>("["… May 12, 2026 at 6:27 pm
  • Editorial Team
    Editorial Team added an answer As the "lite" part of the name implies, sqlite3 is… May 12, 2026 at 6:27 pm
  • Editorial Team
    Editorial Team added an answer I've used Symantec Scan engine (http://www.symantec.com/business/scan-engine) with some success calling… May 12, 2026 at 6:26 pm

Related Questions

Do you find that when you work with a new technology that you're never
I currently have this line of code which has been working for the past
I have been going crazy with binding a combobox to an enum typed property
I have a wcf serivce I want to consume from a j2me application (blackberry).
Ok, I'm going crazy. I've been trying to make a simple .net assembly visible

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.