ajax return large amounts of data exceeds the upper limit of the solution to the page

参考网页:https://www.cnblogs.com/ericli-ericli/p/5615644.html

web.config中添加以下内容
<system.web.extensions>
    <scripting>
        <webServices>
            <jsonSerialization maxJsonLength="1024000000" />
        </webServices>
    </scripting>
</system.web.extensions>

He said that under this approach with more perfect, I use the 2003 nor how to JavaScriptSerializer not come out new.

public ActionResult GetLargeJsonResult()
{
  return new ContentResult
    {
        Content = new JavaScriptSerializer { MaxJsonLength = Int32.MaxValue }.Serialize(listResult),
        ContentType = "application/json"
    };
}

 

In addition, it was found a more thorough explanation of the post accompanied Address: http://www.cnblogs.com/artech/archive/2012/08/15/action-result-03.html

Guess you like

Origin blog.csdn.net/wxmwzz/article/details/91166436