public static string ProcessRazorView(ISchema schema, string form, out bool rendered) { string controlFile = GetFormView(form); rendered = false; if (System.IO.File.Exists(controlFile)) { if (HttpContext.Current != null && HttpContext.Current.Items["ControllerContext"] != null) { var controllerContext = (ControllerContext)HttpContext.Current.Items["ControllerContext"]; var viewData = new ViewDataDictionary() { Model = schema }; rendered = true; return(RazorViewHelper.RenderView(GetFormViewVirtualPath(form), controllerContext, viewData)); } } return(""); }
public static string ProcessRazorView(ISchema schema, IColumn column, out bool rendered) { string controlFileVirutalPath = GetControlViewVirtualPath(column.ControlType); rendered = false; if (!string.IsNullOrEmpty(controlFileVirutalPath)) { if (HttpContext.Current != null && HttpContext.Current.Items["ControllerContext"] != null) { var controllerContext = (ControllerContext)HttpContext.Current.Items["ControllerContext"]; var viewData = new ViewDataDictionary() { Model = column }; viewData["Schema"] = schema; rendered = true; return(RazorViewHelper.RenderView(controlFileVirutalPath, controllerContext, viewData)); } } return(""); }