public static void AddCustomContentQueryWebPart(SPWeb web, string pageUrl, string zoneId, int zoneIndex, string title, PartChromeState chromState, PartChromeType chromeType) { NCNewssitePatch1CustomContentQueryWebPart customContent = new NCNewssitePatch1CustomContentQueryWebPart(); customContent.ZoneID = zoneId; customContent.Title = title; customContent.ChromeState = chromState; customContent.ChromeType = chromeType; AddWebPart(web, customContent, pageUrl, zoneIndex); }
protected override void CreateChildControls() { base.CreateChildControls(); webpart = this.WebPartToEdit as NCNewssitePatch1CustomContentQueryWebPart; toolPanel = new Panel(); toolPanel.Controls.Add(GetToolPanel()); publishAtDropdown.SelectedValue = webpart.PublishAt; optPublishAt.Checked = webpart.DisplayLatestArticle; optManual.Checked = !webpart.DisplayLatestArticle; this.Controls.Add(toolPanel); }