Problem with MaxJsonLength when using ajax

0

Hello,

I'm using ajax to build a table in an application, but when the event is triggered, javascript does not perform html construction, giving the following error:

"Error during serialization or deserialization using JSON JavaScriptSerializer.   String size exceeds the value set in the property   maxJsonLength. "

I've tried increasing the maxLength value, but it did not solve the problem. How do I resolve this?

    
asked by anonymous 23.10.2018 / 17:45

1 answer

0

Friend tries like this:

var json = Json(new { seuRetornoAqui }, JsonRequestBehavior.AllowGet);
json.MaxJsonLength = Int32.MaxValue;
return json;
    
10.12.2018 / 18:02