本文介绍了JSON请求太大,无法反序列化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将flexgrid数据传递到控制器中,但是会弹出一个错误,提示:

I'm trying to pass my flexgrid datas into my controller but going to the controller an error just pop:

控制器:

public ActionResult Testing(IList<Models.Schedule.plan> pParameter)
{
     //Codes...
     return Json("successfully saved!", JsonRequestBehavior.AllowGet);
}

JS

_app.factory('_var ', ['$http', function ($http) {
    var _var = {};
    _var.checkList = function (pModelList) {
        return $http.post('Schedule/Testing', {           //Error occur here
            pParameter: pModelList
        });
    }
    return _var;
}]);

_app.controller('testingController', function ($scope, _var, $http) {
$scope.checkList = function () {
        console.log($scope.GivingList["_src"]);
        _var.checkList($scope.GivingList["_src"])
            //Some Other Codes
    }
});

或者您对此有其他建议吗?预先谢谢你

Or do you have other suggestions in making this? Thank you in advance

推荐答案

进行应用设置,并为aspnet:MaxJsonDeserializerMembers设置更高的值:

Take your Appsettings, and Set a higher value for aspnet:MaxJsonDeserializerMembers:

<appSettings>
  <add key="aspnet:MaxJsonDeserializerMembers" value="20000" />
</appSettings>

这篇关于JSON请求太大,无法反序列化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 01:51