Style missing from AjaxToolkit Tab Container

If you notice the style is missing from your AjaxToolkit Tab Container. It could be due to the fact that when your page first loads this element is not visible either due to a surrounding div not being visible. This may cause the stylesheet for the Tab container not to load on subsequent postbacks when you make the Tab Container visible.

I have not 100% confirmed this but this might steer you in the right direction.

When the page first loads if the Tab Container is not visible the style for the tabs is not loaded. If you then have a Postback which then makes the Tab Container visible your Tab Container will appear but will not have any styles assigned to it.

The solution to this is to make it visible up until the last moment and then hide it.

I know this description is not that clear but it might help you narrow down the issues you see.


<div id="pnlTabBars" runat="server" visible="false">
  <br />
  <ajaxToolkit:TabContainer ID="InformationTab" runat="server" >
    <ajaxToolkit:TabPanel ID="Tab1" runat="server" ToolTip="Tab1">
      <ContentTemplate>
        <asp:Literal ID="ltlTab1" runat="server"></asp:Literal>
      </ContentTemplate>
    </ajaxToolkit:TabPanel>
    <ajaxToolkit:TabPanel ID="Tab2" runat="server" ToolTip="Tab1">
      <ContentTemplate>
        <asp:Literal ID="ltlTab1" runat="server"></asp:Literal>
      </ContentTemplate>
    </ajaxToolkit:TabPanel>
  </ajaxToolkit:TabContainer>
</div>

Tags: , , ,

Leave a Reply