Can I set an unlimited length for maxJsonLength in web.config?
Asked 07 September, 2021
Viewed 2.1K times
  • 58
Votes

I am using the autocomplete feature of jQuery. When I try to retrieve the list of more then 17000 records (each won't have more than 10 char length), it's exceeding the length and throws the error:


  

Exception information:
Exception type: InvalidOperationException
Exception message: Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.

Can I set an unlimited length for maxJsonLength in web.config? If not, what is the maximum length I can set?

30 Answer