public List <Control> GetTemplateTopAndBottomSegments(System.Web.UI.Page control) { var masterPage = GetMasterPage(); var templateTopAndBottomSegments = new List <Control>(); if (masterPage != null) { var topAndBottomSegments = StringHelper.SplitByString(masterPage.Layout, "{PageContent}"); if (topAndBottomSegments.Length > 1) { templateTopAndBottomSegments.Add(control.ParseControl(MediaDetailsMapper.ParseSpecialTags(this, topAndBottomSegments.ElementAt(0)))); templateTopAndBottomSegments.Add(control.ParseControl(MediaDetailsMapper.ParseSpecialTags(this, topAndBottomSegments.ElementAt(1)))); return(templateTopAndBottomSegments); } } return(templateTopAndBottomSegments); }
public static string RenderPage(System.Web.UI.Page page, string html) { var str = new System.IO.StringWriter(); var wrt = new HtmlTextWriter(str); page.ParseControl(html).RenderControl(wrt); html = str.ToString(); return(html); }