我正在使用AjaxControlToolkit
版本4.1,.NET 4.0,VS2010,language-c#
使用TabContainer
控件我想动态添加/删除标签。假设我有一些.aspx页面。在第一个标签中,我有一些hyperlink
。虽然我将点击hyperlink
相应的.aspx页面将动态打开一个标签,我也可以删除它。怎么做?任何人都可以帮助我吗?
答案 0 :(得分:0)
创建强>
Create TabContainer
Dim tbContainer As New AjaxControlToolkit.TabContainer
tbContainer.ID = "TabContainer1"
Create TabContent
Dim tbContent As New Control
tbContent.ID = "tbContent_" & dt.Rows(i).Item("PRENR").ToString
Create TabPanel
Dim tbPanel As New AjaxControlToolkit.TabPanel
tbPanel.ID = "tbPanel_" & dt.Rows(i).Item("PRENR").ToString
tbPanel.HeaderText = "PREMIUM AMOUNT"
Adding the controls to Page
tbContent.Controls.Add(dvEarner1)
tbPanel.Controls.Add(tbContent)
tbContainer.Tabs.Add(tbPanel)
tbContainer.Tabs.Add(tbPanel1)
tbContainer.Tabs.Add(tbPanel2)
tbContainer.Tabs.Add(tbPanel3)
tbContainer.Tabs.Add(tbPanel4)
tbContainer.Tabs.Add(tbPanel5)
pane.ContentContainer.Controls.Add(tbContainer)
Me.MainAccordion1.Panes.Add(pane)
删除强>
Me.TabContainer1.Tabs.Remove(tab)