单击按钮创建动态选项卡 [英] 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?
推荐答案
尝试这些
动态地将标签面板添加到标签容器 [ ^ ]
动态创建的标签面板 [
Try these
Dynamically adding tab panels to tab containers[^]
Dynamically Created Tab Panels[^]
这篇关于单击按钮创建动态选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文