Handling huge data via jquery ajax

自闭症网瘾萝莉.ら 提交于 2019-12-10 11:37:08

问题


I m building a blog in asp.net. I want to use jquery to add the posts and display them too. But I m not sure if it is gonna work fine in case of huge posts because last time I had problem posting a huge data using jquery ajax. The json object was truncated after 50000 characters by Firebug saying the

Request Size Limit has been reached

I noticed for even for a normal post the number of characters cross 50K. Is there a way to solve this "request size limit" or "is it a bad idea to pass such huge data using jquery". Please suggest me. Thanks


回答1:


You could also try and set this setting in your web.config:

<configuration> 
   <system.web.extensions>
       <scripting>
           <webServices>
               <jsonSerialization maxJsonLength="50000000"/>
           </webServices>
       </scripting>
   </system.web.extensions>
</configuration> 

More information can be found here:

http://msdn.microsoft.com/en-us/library/system.web.script.serialization.javascriptserializer.maxjsonlength.aspx

Good luck!




回答2:


I think the issue is a limitation of Firebug and NOT the Ajax request. Firebug has limits of how much data is shown in its network panel.

See this: Firebug Preferences

This is the default:

cache.responseLimit
Maximum size limit for cached and displayed network responses
bytes 5242880



来源:https://stackoverflow.com/questions/10478149/handling-huge-data-via-jquery-ajax

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!