JSON最大长度问题与ASP.NET

我正在创建一个asp.net 2.0 webservice,它将json作为输出,并且有一个非常大的,不能分解的,超过最大长度限制的数据集

我在互联网上搜索,并有.net 3.5& 4,但不是2.0.

有什么可以告诉我如何增加JSON legth limit?

解决方法

我有同样的确切问题.看到3.5和4.0解决方案感到沮丧.原来你做同样的事情,你只需要添加几条线到< ConfigSections>您的Web.config中的标签.当它粘贴它应该是根下的第一个元素.
<configSections>
    <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup,System.Web.Extensions,Version=1.0.61025.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35">
        <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup,PublicKeyToken=31bf3856ad364e35">
            <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup,PublicKeyToken=31bf3856ad364e35">
                <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection,PublicKeyToken=31bf3856ad364e35" requirePermission="false"/>
            </sectionGroup>
        </sectionGroup>
    </sectionGroup>
</configSections>

然后添加到实际的< system.web.extensions>部分:

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

相关文章

前言 做过web项目开发的人对layer弹层组件肯定不陌生,作为l...
前言 前端表单校验是过滤无效数据、假数据、有毒数据的第一步...
前言 图片上传是web项目常见的需求,我基于之前的博客的代码...
前言 导出Excel文件这个功能,通常都是在后端实现返回前端一...
前言 众所周知,js是单线程的,从上往下,从左往右依次执行,...
前言 项目开发中,我们可能会碰到这样的需求:select标签,禁...