Return large string from ajax call using Jquery to Web Method of ASP.NET

前端 未结 1 462
梦如初夏
梦如初夏 2020-12-16 01:40

Inside my ASP.NET website I am calling a Web Method using Jquery as follows:

 $.ajax({
    type: \"POST\",
    contentType: \"application/json; charset=utf-8         


        
相关标签:
1条回答
  • 2020-12-16 02:11

    Most probably you have exceeded MaxJsonLength, by default it is 102400 characters and your string is bigger. You can increase this limit in web.config:

    <configuration>
        ... 
        <system.web.extensions>
            <scripting>
                <webServices>
                    <jsonSerialization maxJsonLength="300000" />
                </webServices>
            </scripting>
        </system.web.extensions>
        ...
    </configuration> 
    
    0 讨论(0)
提交回复
热议问题