1
Answer

create dynamic tab on button click

saifullah khan

saifullah khan

13y
1.5k
1
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?
Answers (1)