My problem is that when I post data with ajax with code below
$.ajax({
type: 'POST',
url: '@Url.Action("ChangeOrder", "Menu")',
data: JSON.stringify(array),
success: function (data, status, xhr) {
if (data.Status == 200) {
toastr.success('@Resources.Resource.Success_MenuOrderSave');
}
else {
toastr.error('@Resources.Resource.Error_Unexpected');
return;
}
},
dataType: "json",
contentType: "application/json; charset=utf-8",
beforeSend: function () {
},
complete: function () {
}
});
It occurs error when send array that has 227 item in it, but it work if array has 10 items , Is there a limit for this ?
var item = {
refMenu: data[i].id,
refParent: null,
refPortal: "@SessionRepository.GetPortalId()",
Order:i+1
}
array of item is above. Error is 500 it acts as get method when array is big. but it works when array is not big
Error is
Exception Details: System.InvalidOperationException: The JSON request was too large to be deserialized.
Thanks in advance
Try a bigger value for aspnet:MaxJsonDeserializerMembers in the web.config:
<appSettings>
<add key="aspnet:MaxJsonDeserializerMembers" value="150000" />
</appSettings>
Set a higher max JSON value for aspnet:MaxJsonDeserializerMembers in the appSettings:
<appSettings>
<add key="aspnet:MaxJsonDeserializerMembers" value="1000000" />
</appSettings>