Problem with Maxjsonlength when using ajax

Asked

Viewed 790 times

0

Hello,

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

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

I tried to increase the value of maxlength, but it didn’t solve the problem. How to solve this?

1 answer

0


Friend tries so:

var json = Json(new { seuRetornoAqui }, JsonRequestBehavior.AllowGet);
json.MaxJsonLength = Int32.MaxValue;
return json;
  • Solved my problem, thank you

Browser other questions tagged

You are not signed in. Login or sign up in order to post.