问题描述
朋友,
我已经动态创建了选项卡面板,并尝试使用以下代码现在显示它们:
//创建一个与TabID相关联的新TabPanel
AjaxControlToolkit.TabPanel选项卡=新的AjaxControlToolkit.TabPanel();
tab.HeaderText = dirList [i];
tab.ID ="ID" + i + 1;
//将TabPanel添加到包含动态选项卡的TabContainer中
TabContainer1.Tabs.Add(tab);
现在,我有兴趣捕获这些动态生成的选项卡的点击事件.
我认为我们可以通过以下方式进行操作:
但这无法解决:
if(tab.selectedevent =="dirList [i]")
{
}
Hi Friends,
I have created tab panel dynamically and trying to display them now by using following code:
//creating a new TabPanel that is associated with the TabID
AjaxControlToolkit.TabPanel tab = new AjaxControlToolkit.TabPanel();
tab.HeaderText = dirList[i];
tab.ID = "ID" + i+1;
//Adding the TabPanel to the TabContainer that contains the dynamic tabs
TabContainer1.Tabs.Add(tab);
Now I am interested to capture click event of these dynamically generated tabpanels.
I think we can do in the following way:
but this is not working out:
if(tab.selectedevent =="dirList[i]")
{
}
推荐答案
You can do like this in JQuery
这篇关于捕获动态生成的选项卡的单击事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!