ASP.NET - Ajax Control Toolkit - TabContainer always hidden

我与影子孤独终老i 提交于 2019-12-12 16:13:16

问题


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


回答1:


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?




回答2:


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




回答3:


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.




回答4:


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




回答5:


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




回答6:


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!




回答7:


Try setting ActiveTabIndex="0" on the TabContainer



来源:https://stackoverflow.com/questions/5463966/asp-net-ajax-control-toolkit-tabcontainer-always-hidden

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!