Hi,
I'd do this dynamic tab panel creation this way (it also works in the Page_Load event handler):
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
Control tabContent = new Control();
TabPanel tab = new TabPanel();
tab.ID = "tabPanel1";
tab.HeaderText = "Dynamic Panel";
Label label = new Label();
label.Text = "This is a dynamic tab panel";
tabContent.Controls.Add(label);
tab.Controls.Add(tabContent);
this.tabContainer1.Tabs.Add(tab);
}
This pice of code works for me perfect. The tabContainer1 control is of type AjaxControlToolkit.TabContainer and is declared on the page this way:
<ajaxcc:TabContainer ID="tabContainer1" runat="server">
</ajaxcc:TabContainer>
Happy Coding:rose::rose::thumbsup: :)