Can I set an unlimited length for maxJsonLength in web.config?

后端 未结 29 3193
礼貌的吻别
礼貌的吻别 2020-11-21 06:43

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 le

29条回答
  •  梦如初夏
    2020-11-21 07:25

    For those who are having issues with in MVC3 with JSON that's automatically being deserialized for a model binder and is too large, here is a solution.

    1. Copy the code for the JsonValueProviderFactory class from the MVC3 source code into a new class.
    2. Add a line to change the maximum JSON length before the object is deserialized.
    3. Replace the JsonValueProviderFactory class with your new, modified class.

    Thanks to http://blog.naver.com/techshare/100145191355 and https://gist.github.com/DalSoft/1588818 for pointing me in the right direction for how to do this. The last link on the first site contains full source code for the solution.

提交回复
热议问题