ASP.NET - Ajax Control Toolkit - TabContainer always hidden

Farhad picture Farhad · Mar 28, 2011 · Viewed 11.9k times · Source

I used the following code to add TabContainer to page

      <asp:TabContainer ID="TabContainer1" runat="server">

        <asp:TabPanel runat="server" HeaderText="tab one" ID="TabPanel0">
            <ContentTemplate>
                <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
            </ContentTemplate>
        </asp:TabPanel>

         <asp:TabPanel runat="server" HeaderText="tab two" ID="TabPanel1">
            <ContentTemplate>
                <asp:Button ID="Button1" runat="server" Text="Button" />
            </ContentTemplate>
        </asp:TabPanel>

    </asp:TabContainer>

but when the page is rendered TabPanel is always Hidden,I wateched the html code by Firebug and found visibility is hidden... what is the problem? http://i.stack.imgur.com/m1eSW.jpg

Answer

Tim Schmelter picture Tim Schmelter · Mar 28, 2011

Have you tried to set the ActiveTab-Property(from codebehind) or the ActiveTabIndex from codebehind or aspx?

You could also check if it works if you explicitly set the display to visible:

ActiveTabIndex="0" style="display:block;visibility:visible;"

Are you sure that the Ajax libraries are loaded correctly? Do you have other Ajax-Controls inside of your TabContainer? Check if all of your html in that page is valid.

Are you using the latest AjaxToolkit and the ToolkitScriptManager instead of the ScriptManger?