public static string RenderView(string path, bool populateFromQueryString, out IServiceMetadata metadata, out IPagingDataProvider pagingData) { Page page = new Page(); UserControl ctrl = (UserControl)page.LoadControl(path); return RenderControlInternal(page, ctrl, populateFromQueryString, out metadata, out pagingData); }
private static string RenderControlInternal(Page page, Control ctrl, bool populateFromQueryString, out IServiceMetadata metadata, out IPagingDataProvider pagingData) { if (populateFromQueryString) { Populate(ctrl); } using (StringWriter sw = new StringWriter()) { page.Controls.Add(ctrl); HttpContext.Current.Server.Execute(page, sw, false); metadata = GetServiceMetadata(ctrl); pagingData = GetPagingData(ctrl); return sw.ToString(); } }
public static string RenderView(string path, out IServiceMetadata metadata, out IPagingDataProvider pagingData) { return RenderView(path, true, out metadata, out pagingData); }