简体   繁体   中英

Issue in sending large JSON data to action method through ajax post in asp.net mvc application

I am generating an XML using JavaScript and trying to send it to an action method through AJAX POST call. It's working fine up to certain XML length. But as the XML is getting lengthier, I am receiving broken XML in the action method.

I tried followings to increase the request length but still unable to fix the issue. However AJAX GET is working fine.

Please do help me on this.

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


<system.web>
  <httpRuntime executionTimeout="240" maxRequestLength="20480" />
</system.web>


<system.webServer>
   <security>
      <requestFiltering>
         <requestLimits maxAllowedContentLength="3000000000" />
      </requestFiltering>
   </security>
</system.webServer>

您增加了maxJsonLength,但这仅用于GET,请尝试也增加maxRequestLength的值。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM