public override void Response(HttpContext context, string controllerFullName, string methodName, object model, Dictionary <string, object> viewData) { string tType = TempateEngineType.ToString(); string virtualPath = null; string controllerName = UrlRouteCenter.GetUserDefineName(controllerFullName); var basString = "~/Views/" + controllerName + "/" + methodName; if (string.IsNullOrEmpty(TemplateVirtualPath)) { if (IsMoblieRquest(context)) { virtualPath = basString + ".Mobile." + tType; var str = context.Server.MapPath(virtualPath); if (File.Exists(str) == false) { virtualPath = basString + "." + tType; } } else { virtualPath = basString + ".PC." + tType; var str = context.Server.MapPath(virtualPath); if (File.Exists(str) == false) { virtualPath = basString + "." + tType; } } } else { virtualPath = this.TemplateVirtualPath; } string result = null; result = RenderUtil.RenderAspx(context, virtualPath, model, viewData); SetResponseEncoding(context); context.Response.Write(result); context.Response.Flush(); // context.Response.End();//2015年9月13日15:02:52 }
/// <summary> /// 反馈model到指定aspx文件中 /// </summary> /// <param name="aspxFileVrtualPath"></param> /// <param name="model"></param> protected void ReturnModel(string aspxFileVrtualPath, object model, Dictionary <string, object> viewData) { string content = RenderUtil.RenderAspx(CurrentHttpContext, aspxFileVrtualPath, model, viewData); ReturnText(content); }
public string Partial(string virtualPath) { string content = RenderUtil.RenderAspx(_context, virtualPath, this.Model, this.ViewData); return(content); }
public static string Partial(string virtualPath, object model, Dictionary <string, object> viewData) { string content = RenderUtil.RenderAspx(HttpContext.Current, virtualPath, model, viewData); return(content); }
//---------------- public string Partial(string virtualPath, TModel model, Dictionary <string, object> viewData) { string content = RenderUtil.RenderAspx(_context, virtualPath, model, viewData); return(content); }