Wednesday, March 21, 2012

TabContainer drawing issue

I have TabContainer within a panel that is on a usercontrol. The user control is on a page that houses everything in an UpdatePanel. I have many user controls all activated/de-activated when a value changes in a dropdownlist control.

When the page containing the usercontrol is first rendered I have the panel visibility set to false so I see noting from this control as expected. When I trigger the need for the usercontrol I then set the panel visibility to true. This works for all other controls but I wanted to put the new tabs on this control.

The problem is that the TabContainer on this control does not draw anything except the bare controls that are on the first tab with NO styles, colors etc. I maintain a page state enum so that I know what to show the user if they refresh the page completely. If I refresh (F5) the page at this point I now see everything correctly and can use the tabs. Does anyone have a fix for this issue? I am sure it has something to do with my setting the containing panel visibility false to begin with but I cannot seem to find a solution.

The user control setup is basically what I have below, nothing special.

<asp:PanelID="pnlCardSearch"runat="server" visibility="false">
<ajaxToolkit:TabContainerrunat="server"ID="Tabs"Height="150px"OnClientActiveTabChanged="ActiveTabChanged">
<ajaxToolkit:TabPanelrunat="Server"ID="Panel1"HeaderText="Signature and Bio">
<ContentTemplate>
<asp:UpdatePanelID="UpdatePanel1"runat="server">
</asp:UpdatePanel>
<asp:UpdatePanelID="UpdatePanel2"runat="server">
</asp:UpdatePanel>
</ContentTemplate>
</ajaxToolkit:TabPanel>
</ajaxToolkit:TabContainer>
</asp:Panel
I'm just trying to get it to work using the tab example at this point.

I know posts like this aren't helpful, but i've got a very similar setup to that described above (usercontrol, updatepanel, tabcontainer), and i'm experiencing the same issue.

I'm adding a tabcontainer programatically, and when it first appears, it has no borders, no tab images, no anything really, yet the functionality still works. When you refresh the page, it appears as normal. In my case, it seems that if you add the tabcontainer during the OnInit event, it renders properly, yet if you add it as the result of a postback event, later in the page cycle, it renders improperly as described above.

If anyone could shed any light on this then i'd be grateful.

Cheers


Hello,

Did you find a solution to your problem? I am having the same problem with the same setup. Could you share the code on how you are mainting state of the page with the Enum and how you activating and deactivating your controls.

Thanks

No comments:

Post a Comment