Click here to Skip to main content
14,028,233 members
Rate this:
 
Please Sign up or sign in to vote.
See more:
I have created tab container in aspx page of asp.net in which tab panel's be created dynamically from code behind. It is not displaying but code execution is working. I have 10 tabs to display each and every tab will have tab content from database. For these 10 tabs to display i have chosen vertical strip.

What I have tried:

In aspx page:
<asp:UpdatePanel ID="upTabContainer" runat="server">
    <ContentTemplate>
        <asp:PlaceHolder ID="PlaceHolder1" runat="server">
            <cc1:TabContainer ID="Tabs" runat="server"                              VerticalStripWidth="50px" UseVerticalStripPlacement="true">
            </cc1:TabContainer>
        </asp:PlaceHolder>
    </ContentTemplate>
</asp:UpdatePanel>

In Codebehind:
foreach (DataRow dataRow in dt.Rows)
{
    int index = dt.Rows.IndexOf(dataRow);
    if (value == Session["topValue"].ToString())
    {
        AjaxControlToolkit.TabPanel tabPanel = new AjaxControlToolkit.TabPanel()
        {
            ID = string.ToLower(),
            HeaderText = value
        };
        Tabs.ActiveTabIndex = index;
        Tabs.Controls.Add(tabPanel);
    }
    else
    {
        AjaxControlToolkit.TabPanel tabPanel = new AjaxControlToolkit.TabPanel()
        {
            ID = string.ToLower(),
            HeaderText = value
        };
        Tabs.Controls.Add(tabPanel); //Tabs is id of Tabcontainer
    }
}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web01 | 2.8.190419.4 | Last Updated 3 Dec 2018
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100