p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   ASP.NET 2.0 Professional (http://p2p.wrox.com/forumdisplay.php?f=215)
-   -   Dynamic controls inside a ajax:tabpanel (http://p2p.wrox.com/showthread.php?t=74268)

mike_remember May 6th, 2009 07:45 AM

Dynamic controls inside a ajax:tabpanel
 
Hi

I have an ajax:tabcontainer with 2 tabpanels, one has an <asp:panel> in which I am creating and rendering some dynamic controls on server side. Now the problem is that once these dynamic controls are loaded in the first tab panel, the contents of second tab panel are not shown, if I view the source of page, the content of second tab panel is hidden as style="visibility:hidden;display:none;", example of my code is as below

<cc1:TabContainer ID="TabContainer1" runat="server" ActiveTabIndex="0" >
<cc1:TabPanel ID="TabPanel1" runat="server" HeaderText="TabPanel4">
<HeaderTemplate>
First tab
</HeaderTemplate>
<ContentTemplate>
<ASP:PANEL runat="server" Height="100%" id="DynamicPanel"></ASP:PANEL>
</ContentTemplate>
</cc1:TabPanel>
<cc1:TabPanel ID="TabPanel2" runat="server" HeaderText="TabPanel4">
<HeaderTemplate>
Second Tab
</HeaderTemplate>
<ContentTemplate>
<ccc:usercontrol />
</ContentTemplate>
</cc1:TabPanel>
</cc1:TabContainer>
protected override void OnInit(EventArgs e)
{
//Code to create dynamic control and add them to the second tab's panel
//DynamicPanel
}

mike_remember May 6th, 2009 09:09 AM

To be more precise, this issue occurs when I add controls to the panel using the code below

Control ctrl = ControlHolder.Page.ParseControl(result);
ControlHolder.Controls.Add(ctrl);

ControlHolder is the panel
resut is the string which I get from XslTransform


All times are GMT -4. The time now is 12:40 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.