我已经动态创建了一个手风琴窗格,但现在我想将 Ajax TabContainer 添加到我的手风琴窗格中,其中包含多个选项卡,但由于某种原因,如果我添加多个选项卡它不会显示,但在我的页面源代码中它会显示。如果我只添加一个选项卡,它会显示,但不会显示我添加到其中的控件。
这是我的代码:
'Create AccrionPane
Dim pane As New AjaxControlToolkit.AccordionPane
pane.ID = "pane_" & dt.Rows(i).Item("PRENR").ToString
pane.HeaderContainer.Controls.Add(headerLabel1)
pane.HeaderContainer.Controls.Add(headerLabel2)
'Create TabContainer
Dim tbContainer As New AjaxControlToolkit.TabContainer
tbContainer.ID = "container_" & dt.Rows(i).Item("PRENR").ToString
'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)
我究竟做错了什么?我想在手风琴窗格的每个选项卡中显示 DetailsViews