I am using version NetAdvantage version 8.2.20082.2010 for asp.net in version 3.5 of the CLR. I have a page that contains an instance of the Ultrawebtab control and am attempting to dynamically create tabs that contain web part zones. As required, the web part zone control instances are being created during the OnInit() event of the page lifecycle and immediatly added to the content template of a newly created Tab instance. However, an exception is being thrown during the OnLoad() event indicating that the zones must be created on or before the OnInit() event of the page. If I add the zones to another container on the page, all works fine. I suspect that something within the tab content control is causing the zone control "creation" to be defered until the Page Load event, but I certainly can't verify that for sure. Can anyone please shed some light on what is happening here and possibly point me toward a solution for dynamically creating the web part zones within a tab content template (short of not using the Ultrawebtab)?
Thanks,
js
OK, I found a solution (although it may not be "recommended", it works). Since the web part zones have to be added to during OnInit(), I used reflection to invoke the protected EnsureChildControls() method on the UltraWebTab instance as follows:
UltraWebTab1.GetType().InvokeMember("EnsureChildControls", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.FlattenHierarchy | System.Reflection.BindingFlags.InvokeMethod | System.Reflection.BindingFlags.NonPublic, null, UltraWebTab1, null);
were UltraWebTab1 is the tab control...
Let me clarify the part about the zone creation being deferred. What I mean is, the zone controls are not being added to the page until the OnLoad() event. I assume this is being controlled by the tab content. I guess what I am asking is:
Is there any way to force the tab content to add its child controls to the page during the OnInit() event?
Thanks