예제 #1
0
        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
        }
예제 #2
0
        /// <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);
        }
예제 #3
0
        public string Partial(string virtualPath)
        {
            string content = RenderUtil.RenderAspx(_context, virtualPath, this.Model, this.ViewData);

            return(content);
        }
예제 #4
0
파일: MPage.cs 프로젝트: twislyn/Moon.Mvc
        public static string Partial(string virtualPath, object model, Dictionary <string, object> viewData)
        {
            string content = RenderUtil.RenderAspx(HttpContext.Current, virtualPath, model, viewData);

            return(content);
        }
예제 #5
0
        //----------------
        public string Partial(string virtualPath, TModel model, Dictionary <string, object> viewData)
        {
            string content = RenderUtil.RenderAspx(_context, virtualPath, model, viewData);

            return(content);
        }