4

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? https://i.stack.imgur.com/m1eSW.jpg

Farhad
  • 803
  • 4
  • 8
  • 20

7 Answers7

6

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?

Tim Schmelter
  • 450,073
  • 74
  • 686
  • 939
  • I used ScriptMangager instead of ToolkitScriptManager because of a problem and tips on this page http://forums.asp.net/t/1273185.aspx/2/10 ,it is the problem of .NET 3.5? – Farhad Mar 28 '11 at 20:37
2

You need to use the Script Manager from the Ajax Control Toolkit, add it after the form tag.

jmnf
  • 21
  • 1
2

i had the same issue and after 2 hours of googling i found a solution. In my case I had to change asp:ScriptManager to ajaxToolkit:ToolkitScriptManager.

Mukhtar
  • 111
  • 1
  • 4
0

We've solved this problem at our company, after trying everything found on websites by changing the website's appPool from Classic to Integrated.

MelloG
  • 1,044
  • 1
  • 11
  • 11
0

In my case: The active tab was hidden (server side: Visible="false"). It seems if you activate in server side a hidden tab, it'll add visibilty:hidden to the tabcontainer!

Robert
  • 5,278
  • 43
  • 65
  • 115
A.Akram
  • 412
  • 5
  • 22
0

You may want check that you have used ToolkitScriptManager instead of ScriptManager. This will solve your problem.

McGarnagle
  • 101,349
  • 31
  • 229
  • 260
taha
  • 1
-1

Try setting ActiveTabIndex="0" on the TabContainer

e36M3
  • 5,952
  • 6
  • 36
  • 47