• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# JsonRequestBehavior类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: JsonFormat

 public static FormatJsonResult JsonFormat(this Controller c
     , object data
     , JsonRequestBehavior behavior = JsonRequestBehavior.DenyGet)
 {
     FormatJsonResult result = new FormatJsonResult();
     result.Data = data;
     result.JsonRequestBehavior = behavior;
     return result;
 }
开发者ID:mmxftp,项目名称:JSMiracle.AutoWarehouse,代码行数:9,代码来源:JsonHelper.cs


示例17: Json

 protected override JsonResult Json(object data, string contentType, Encoding contentEncoding, JsonRequestBehavior behavior)
 {
     return new ServiceStackJsonResult
     {
         Data = data,
         ContentType = contentType,
         ContentEncoding = contentEncoding
     };
 }
开发者ID:GabrielCapano,项目名称:transito-de-,代码行数:9,代码来源:BaseController.cs


示例18: Json

 protected internal virtual DirectResult Json(object data, string contentType, Encoding contentEncoding, JsonRequestBehavior behavior, JsonSerializerSettings settings) {
     return new DirectResult {
         Data = data,
         ContentType = contentType,
         ContentEncoding = contentEncoding,
         Settings = settings,
         JsonRequestBehavior = behavior
     };
 }
开发者ID:taskeenkayani,项目名称:ext-direct-mvc,代码行数:9,代码来源:DirectController.cs


示例19: Json

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


示例20: Json

 protected override JsonResult Json(object data, string contentType, Encoding contentEncoding, JsonRequestBehavior behavior)
 {
     KnockoutUtilities.ConvertData(data);
        return new JsonResult {
         Data = data,
         ContentType = contentType,
         ContentEncoding = contentEncoding,
         JsonRequestBehavior = behavior
     };
 }
开发者ID:angelcolmenares,项目名称:KnockoutServiceStackDemo,代码行数:10,代码来源:KnockoutServiceStackController.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# JsonResponse类代码示例发布时间:2022-05-24
下一篇:
C# JsonReader.JsonTokenizer类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap