当前位置: 首页>>代码示例>>C#>>正文


C# JsonRequestBehavior类代码示例

本文整理汇总了C#中JsonRequestBehavior的典型用法代码示例。如果您正苦于以下问题:C# JsonRequestBehavior类的具体用法?C# JsonRequestBehavior怎么用?C# JsonRequestBehavior使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


JsonRequestBehavior类属于命名空间,在下文中一共展示了JsonRequestBehavior类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ClientSideViewError

 protected internal JsonResult ClientSideViewError(string error, JsonRequestBehavior behavior)
 {
     ClientSideView jsonView = new ClientSideView();
     jsonView.Error = error;
     jsonView.Success = false;
     return new JsonResult() { Data = jsonView, JsonRequestBehavior = behavior };
 }
开发者ID:shrage,项目名称:dotClientSide,代码行数:7,代码来源:ClientSideControllerBase.cs

示例2: JsonNetResult

 public JsonNetResult(object data, JsonRequestBehavior jsonRequestBehavior, JsonSerializerSettings settings = null)
 {
     this.ContentType = "application/json";
     this.Data = data;
     this.JsonRequestBehavior = jsonRequestBehavior;
     this.Settings = settings;
 }
开发者ID:Rizjiy,项目名称:RMarketMVC,代码行数:7,代码来源:JsonNetResult.cs

示例3: ResultOk

 public static JsonResult ResultOk(object data,JsonRequestBehavior behavior = JsonRequestBehavior.DenyGet)
 {
     JsonResult result = new JsonResult();
     result.Data = new MogJsonResult() {Result = true, Data = data };
     result.JsonRequestBehavior = behavior;
     return result;
 }
开发者ID:jrocket,项目名称:MOG,代码行数:7,代码来源:JsonHelper.cs

示例4: JsonpResult

 public JsonpResult(object data, string contentType, Encoding contentEncoding, JsonRequestBehavior behavior)
 {
     Data = data;
     ContentType = contentType;
     ContentEncoding = contentEncoding;
     JsonRequestBehavior = behavior;
 }
开发者ID:vincentpaca,项目名称:auth,代码行数:7,代码来源:JsonpResult.cs

示例5: JsonFormResponse

        protected ActionResult JsonFormResponse(JsonRequestBehavior jsonRequestBehaviour = JsonRequestBehavior.DenyGet)
        {
            if (ModelState.IsValid)
            {
                return new HttpStatusCodeResult(200);
            }

            var errorList = new List<JsonValidationError>();
            foreach (var key in ModelState.Keys)
            {
                ModelState modelState = null;
                if (ModelState.TryGetValue(key, out modelState))
                {
                    foreach (var error in modelState.Errors)
                    {
                        errorList.Add(new JsonValidationError()
                        {
                            Key = key,
                            Message = error.ErrorMessage
                        });
                    }
                }
            }

            var response = new JsonResponse()
            {
                Type = "Validation",
                Message = "",
                Errors = errorList
            };

            Response.StatusCode = 400;
            return Json(response, jsonRequestBehaviour);
        }
开发者ID:felldek,项目名称:test,代码行数:34,代码来源:BaseController.cs

示例6: JsonNetResult

 public JsonNetResult(object data, string contentType, Encoding contentEncoding, JsonRequestBehavior jsonRequestBehavior)
 {
     this.ContentEncoding = contentEncoding;
     this.ContentType = !string.IsNullOrWhiteSpace(contentType) ? contentType : "application/json";
     this.Data = data;
     this.JsonRequestBehavior = jsonRequestBehavior;
 }
开发者ID:zettasolutions,项目名称:projectBM,代码行数:7,代码来源:JsonNetResult.cs

示例7: DataTableResult

		private DataTableResult(string sEcho, int iTotalRecords, int iTotalDisplayRecords)
		{
			this.JsonRequestBehavior = JsonRequestBehavior.DenyGet;
			this.sEcho = sEcho;
			this.iTotalRecords = iTotalRecords;
			this.iTotalDisplayRecords = iTotalDisplayRecords;
		}
开发者ID:cfeduke,项目名称:DataTables-ASP.NET-MVC,代码行数:7,代码来源:DataTableResult.cs

示例8: JsonNetResult

 public JsonNetResult(object data, JsonRequestBehavior behavior = JsonRequestBehavior.AllowGet, string contentType = null, Encoding contentEncoding = null)
 {
     this.Data = data;
     this.JsonRequestBehavior = behavior;
     this.ContentEncoding = contentEncoding;
     this.ContentType = contentType;
 }
开发者ID:Skynetfy,项目名称:MyTestProgram,代码行数:7,代码来源:JsonNetResult.cs

示例9: JsonCamelCase

 public static JsonNetResult JsonCamelCase(this Controller controller, object data, JsonRequestBehavior jsonBehavior)
 {
     return new JsonNetResult()
     {
         Data = data,
         JsonRequestBehavior = jsonBehavior
     };
 }
开发者ID:noobouse,项目名称:NGChat,代码行数:8,代码来源:ControllerExtensions.cs

示例10: JsonNet

 protected JsonNetResult JsonNet(object data, JsonRequestBehavior behavior = JsonRequestBehavior.DenyGet)
 {
     return new JsonNetResult
     {
         Data = data,
         JsonRequestBehavior = behavior
     };
 }
开发者ID:SharpSeeEr,项目名称:SharpNET.Utilities,代码行数:8,代码来源:JsonNetController.cs

示例11: Json

        protected override JsonResult Json(object data, string contentType, System.Text.Encoding contentEncoding, JsonRequestBehavior behavior)
        {
            // TODO: change all my GET Json request into POST
            /*return base.Json(data, contentType, contentEncoding,
                JsonRequestBehavior.AllowGet);*/
            return new JsonNetResult(data, contentType, contentEncoding, JsonRequestBehavior.AllowGet);

        }
开发者ID:zettasolutions,项目名称:projectWEMS,代码行数:8,代码来源:baseController+.cs

示例12: Json

 protected new JsonResult Json(object data, JsonRequestBehavior behavior)
 {
     return new JsonNetResult()
     {
         Data = data,
         JsonRequestBehavior = behavior
     };
 }
开发者ID:andreimatusevich,项目名称:Ricettario,代码行数:8,代码来源:BaseController.cs

示例13: Jsonp

 public JsonpResult Jsonp(object data, JsonRequestBehavior behavior)
 {
     return new JsonpResult
     {
         Data = data,
         JsonRequestBehavior = behavior
     };
 }
开发者ID:mmozuras,项目名称:DotNetGroup,代码行数:8,代码来源:ApiController.cs

示例14: MyJson

 protected JsonResult MyJson(object data, JsonRequestBehavior behavior, string format)
 {
     return new CustomJsonResult
     {
         Data = data,
         JsonRequestBehavior = behavior,
         FormateStr = format
     };
 }
开发者ID:RockyMyx,项目名称:ASP.NetMvc-Bootstrap,代码行数:9,代码来源:BaseController.cs

示例15: Json

 protected override JsonResult Json(object data, string contentType, System.Text.Encoding contentEncoding, JsonRequestBehavior behavior)
 {
     return new JsonDotNetResult {
         Data = data,
         ContentType = contentType,
         ContentEncoding = contentEncoding,
         JsonRequestBehavior = behavior
     };
 }
开发者ID:Roundaround,项目名称:WadsworthBand,代码行数:9,代码来源:Helpers.cs


注:本文中的JsonRequestBehavior类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。