捕获动态生成的选项卡的单击事件
朋友,
我已经动态创建了选项卡面板,并尝试使用以下代码现在显示它们:
//创建一个与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
( #abpanelid").live(点击' ,函数() { // 您的代码 });
("#abpanelid").live('click',function() { //Your codes });