Although this is queried around 2 years ago, but I'm still facing the issue and there is no way to get out of it without. Is there any way to set Max size for JSON object in Asp.net Core 3.1? There are ways to do this in other .Net frameworks except .Net core (or may I ain't found it yet).
How to Set Max Json Length in .net core
I'm having JSON object array of length around 3k, same file with around 20 objects works fine but as I increase the size the data goes null in controller method (Even while inspecting in DOM, console.log show the exact array of object).
console.log(candidate_List);
$.ajax({
url: '@Url.Action("Insert_Candidates")',
data: { "selected_list": candidate_List },
type: "POST",
dataType: "json",
async: true,
success: function (response) {
alert(response.d);
},
failure: function (response) {
alert("fail");
}
});
[HttpPost]
public async Task<IActionResult> Insert_Candidates([FromForm]List<CandidateDTO> selected_list)
{
string result = "";
if (ModelState.IsValid)
{
}
}