The grid data if I want to
save data in json call then if the json data cross the limit of JsonDeserializer then it will not work on controller action.
function SaveMenuPrivilege() {
var postUrl;
var paramValue;
var gridData = $("#MenuPrivilegeKendoGrid").data("kendoGrid").dataSource.data();
// set model data
for (var i = 0; i < gridData.length; i++) {
gridData[i].NewRoleId = $("#RoleId").val();
}
postUrl = '@Url.Content("~/Admin/MenuPrivilege/SaveMenuPrivilege")';
paramValue = JSON.stringify({ MenuPrivilegeList: gridData }); // you can also set model data using','
$.ajax({
url: postUrl,
type: 'POST',
dataType: 'json',
data: paramValue,
contentType: 'application/json; charset=utf-8',
success: function (result) {
console.log(result);
},
error: function (objAjaxRequest, strError) {
var respText = objAjaxRequest.responseText;
console.log(respText);
}
});
}
public ActionResult SaveMenuPrivilege(MenuViewModel menuViewModel)
{
//
}
To resolve this problem you just need to add in your web config appsetting
<add key="aspnet:MaxJsonDeserializerMembers" value="50000000" />
Comments
Post a Comment