Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JSON request was too larget to be deserialized [duplicate]

Tags:

json

c#

asp.net

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

JSON request was too larget to be deserialized

Controller:

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

like image 700
Me Software Avatar asked Feb 10 '23 02:02

Me Software


1 Answers

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

<appSettings>
  <add key="aspnet:MaxJsonDeserializerMembers" value="20000" />
</appSettings>
like image 135
Bgl86 Avatar answered Feb 12 '23 11:02

Bgl86