create dynamic tab on button click
i want to create dynamic tab on button click. here is the code.
protected void Button1_Click(object sender, EventArgs e)
{
AjaxControlToolkit.TabPanel tab = new AjaxControlToolkit.TabPanel(); // creating new tab panel.
Random rand = new Random();
string randnum = rand.Next(100).ToString();
tab.HeaderText = "Tab number" + randnum;
tab.ID = "tab" + randnum;
TextBox testbox = new TextBox();
testbox.Text="Hello, world!";
tab.Controls.Add(testbox);
TabContainer1.Tabs.Add(tab);
}
but when i click on button it does nothing can somebody tell me what is the problem?