ASP.NET AJAX控件工具箱选项卡控件未显示

本文关键字:控件 显示 选项 工具箱 NET AJAX ASP | 更新日期: 2023-09-27 18:00:36

我有以下用于选项卡控制的代码

<asp:TabContainer ID="exteriorDataTabsContainer" runat="server" Height="150px" Width="400px" ActiveTabIndex="1" style="visibility:visible">
                        <asp:TabPanel HeaderText = "Create task" >
                        <ContentTemplate>
                        create task
                        </ContentTemplate>
                        </asp:TabPanel>
                        <asp:TabPanel HeaderText = "Upload task data">
                        <ContentTemplate>
                        upload task data
                        </ContentTemplate>
                        </asp:TabPanel>
                        <asp:TabPanel HeaderText = "Download task data" >
                        <ContentTemplate>
                        download task data
                        </ContentTemplate>
                        </asp:TabPanel>
                        </asp:TabContainer>

当它被渲染时,它看起来像

<div id="ctl00_ContentPlaceHolder1_exteriorDataTabsContainer" class="ajax__tab_xp" style="width:400px;visibility:hidden;">
    <div id="ctl00_ContentPlaceHolder1_exteriorDataTabsContainer_header" class="ajax__tab_header">
    </div><div id="ctl00_ContentPlaceHolder1_exteriorDataTabsContainer_body" class="ajax__tab_body" style="height:150px;display:block;">

为什么div显示为隐藏在那里?如何使其可见?

ASP.NET AJAX控件工具箱选项卡控件未显示

runat="server"添加到asp:TabPanel

试试这个:

<asp:TabContainer ID="exteriorDataTabsContainer"  ActiveTabIndex="1" runat="server" Height="150px" Width="400px" style="visibility:visible">
                        <asp:TabPanel HeaderText = "Create task" runat="server" ID="a1"   >
                        <ContentTemplate>
                        create task
                        </ContentTemplate>
                        </asp:TabPanel>
                        <asp:TabPanel HeaderText = "Upload task data" runat="server" ID="a2" >
                        <ContentTemplate>
                        upload task data
                        </ContentTemplate>
                        </asp:TabPanel>
                        <asp:TabPanel HeaderText = "Download task data" runat="server" ID="a3" >
                        <ContentTemplate>
                        download task data
                        </ContentTemplate>
                        </asp:TabPanel>
                        </asp:TabContainer>