or

dockLayoutHome_LoadDockLayout event. For the docks that I try to add on "runtime" (I have a RadAjaxPanel which contains the RadDockLayout) I get the following error:System.ApplicationException: A program is attempting to add a new Web Part Zone to this page. Web Part Zones must be defined at the time a Web Part Page is created.
Any help would be appreciated :)
public class CustomRadDock : RadDock { #region Overrides protected override void OnInit(EventArgs e) { base.OnInit(e); this.EnsureChildControls(); } protected override void CreateChildControls() { base.CreateChildControls(); WebPartZone wpZone = new WebPartZone(); wpZone.ID = String.Format("{0}_webPartZone", this.ID); wpZone.PartChromeType = System.Web.UI.WebControls.WebParts.PartChromeType.TitleOnly; this.ContentContainer.Controls.Add(wpZone); LoadWebPart("myname"); } #endregion Overrides #region Methods private void LoadWebPart(String webPartName_) { _log.Info("Adding WebPart to dock"); using (SPSite site = new SPSite("mysite")) { SPWeb web = site.RootWeb; SPFile page = web.GetFile("mypage"); web.AllowUnsafeUpdates = true; web.Update(); using (SPLimitedWebPartManager wpmgr = page.GetLimitedWebPartManager(System.Web.UI.WebControls.WebParts.PersonalizationScope.Shared)) { XmlElement p = new XmlDocument().CreateElement("p"); p.InnerText = "Hello World"; ContentEditorWebPart cewp = new ContentEditorWebPart(); cewp.Content = p; wpmgr.AddWebPart(cewp, String.Format("{0}_webPartZone", this.ID), 0); wpmgr.SaveChanges(cewp); } web.AllowUnsafeUpdates = false; web.Update(); } } #endregion Methods