3 r*_*les 2 asp.net-mvc serialization json jsonresult json-deserialization
我将asp.net mvc actionmethod称为JsonResult作为返回类型,并返回至少具有50000 racords的数据列表,并希望设置Ajax返回的大小,并且它也完成了。
但是当我返回值时,会抛出一个错误:
This request has been blocked because sensitive information could be disclosed to third party web sites when this is used in a GET request. To allow GET requests, set JsonRequestBehavior to AllowGet.
我的代码:
return new JsonResult()
            {
                Data = mydatalist,
                MaxJsonLength = Int32.MaxValue
            };
在这里我想设置JsonRequestBehavior.AllowGet,但是在哪里以及如何不知道?
在事先感谢之前,任何人都可以这样做。
只需查看JsonResult内部提供的选项,您就会找到JsonRequestBehavior并将其设置为allowget。
return new JsonResult()
        {
            Data = mydatalist,
            MaxJsonLength = Int32.MaxValue,
            JsonRequestBehavior = JsonRequestBehavior.AllowGet
        };