Ejemplo n.º 1
0
 public static System.Web.Mvc.JsonResult LargeJson(this System.Web.Mvc.Controller controlador, object data, System.Web.Mvc.JsonRequestBehavior behavior)
 {
     return(new System.Web.Mvc.JsonResult()
     {
         Data = data,
         JsonRequestBehavior = behavior,
         MaxJsonLength = MaxJsonLength
     });
 }
        public override System.Web.Mvc.JsonResult WireJson(DevBridge.Templates.WebProject.Tools.Mvc.WireJson data, System.Web.Mvc.JsonRequestBehavior behavior)
        {
            var callInfo = new T4MVC_JsonResult(Area, Name, ActionNames.WireJson);

            ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "data", data);
            ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "behavior", behavior);
            return(callInfo);
        }
        public override System.Web.Mvc.JsonResult WireJson(bool success, dynamic data, System.Web.Mvc.JsonRequestBehavior behavior)
        {
            var callInfo = new T4MVC_JsonResult(Area, Name, ActionNames.WireJson);

            ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "success", success);
            ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "data", data);
            ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "behavior", behavior);
            return(callInfo);
        }
Ejemplo n.º 4
0
        protected override System.Web.Mvc.JsonResult Json(object data, string contentType, Encoding contentEncoding, System.Web.Mvc.JsonRequestBehavior behavior)
        {
            // return base.Json(FormatJsonData(data), contentType, contentEncoding, behavior);

            return(new JsonResultExtensions()
            {
                Data = FormatJsonData(data),
                ContentType = contentType,
                ContentEncoding = contentEncoding,
                JsonRequestBehavior = behavior
            });
        }