Hi all I have a tab container declared as the following
<
cc1:TabContainer ID="TabContainer1" runat="server"> </cc1:TabContainer>
When I try to add tanbs to this container from the code behind in the page load I use the following code
protected void Page_Load(object sender, EventArgs e)
{
TabContainer1.Tabs.RemoveAt(0);
AjaxControlToolkit.TabPanel panel1 = new AjaxControlToolkit.TabPanel();
panel1.HeaderText = "panel1";
panel1.Visible = true;
panel1.ID = "panel1";
AjaxControlToolkit.TabPanel panel2 = new AjaxControlToolkit.TabPanel();
panel2.HeaderText = "panel2";
panel2.Visible = true;
panel2.ID = "panel2";
TabContainer1.Controls.Add(panel1);
TabContainer1.Controls.Add(panel2);
}
when I run the page nothing appears
but if I declared a tabpanel as this
<cc1:TabContainer ID="TabContainer1" runat="server">
<cc1:TabPanel ID="ss" runat="server">
<ContentTemplate>
123
</ContentTemplate>
</cc1:TabPanel>
</cc1:TabContainer>
The same code works fine
so I guess in order to add tabs programmatically you should have at least one tab declared
is this assumption right ?
thanks
Mina Samy
--------------------------------------------------
http://www.learn-mvc.blogspot.com