我有一个 ajax 控制工具包TabContainer
。活动选项卡通过以下方式使用 c# 进行控制。我的标签容器上有很多标签。
是否可以通过引用 C# 中的选项卡 ID 而不是选项卡的编号来切换选项卡?
C#
TabContainerMain.ActiveTabIndex = 5;
HTML
<asp:TabContainer ID="TabContainerMain" runat="server" ActiveTabIndex="4" Width="100%"
Height="100%" CssClass="" ViewStateMode="Enabled">
<asp:TabPanel runat="server" HeaderText="Tab_Monitor" ID="Tab_Monitor">
</asp:TabPanel>
<asp:TabPanel ID="Tab_Remove_Item" runat="server" HeaderText="Tab_Remove_Item">
<ContentTemplate>
<div class="TabControls">
<p>
Howdy, I'm in Section Tab_Remove_Item .</p>
</div>
<div class="TabsAction">
</div>
</ContentTemplate>
</asp:TabPanel>
<asp:TabPanel ID="Tab_2nd_Sign_System" runat="server" HeaderText="Tab_2nd_Sign_System">
<ContentTemplate>
<div class="TabControls">
<p>
Howdy, I'm in Section Tab_2nd_Sign_System .</p>
</div>
<div class="TabsAction">
</div>
</ContentTemplate>
</asp:TabPanel>
<asp:TabPanel ID="Tab_Configure_Device" runat="server" HeaderText="Tab_Configure_Device">
<ContentTemplate>
<div class="TabControls">
<p>
Howdy, I'm in Section Tab_Configure_Device .</p>
</div>
<div class="TabsAction">
</div>
</ContentTemplate>
</asp:TabPanel>
</asp:TabContainer>