JSON最大长度问题ASP.NET [英] JSON Maximum length problem with ASP.NET

查看:190
本文介绍了JSON最大长度问题ASP.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建一个asp.net web服务2.0这给JSON作为输出,并有一个非常大的,不能被打破,其数据超过最大长度限制

I am creating a asp.net 2.0 webservice which give json as output and there's a very large, can't be break down, dataset which exceed the max length limit

我在互联网上搜索,并有在.NET 3.5安培的解决方案; 4,但不是2.0

I have search on the internet, and there's solution on .net 3.5 & 4, but not 2.0.

任何可以告诉我,我怎么能增加JSON legth限制?

Can any tell me how can I increase the JSON legth limit?

推荐答案

我有这种完全相同的问题。渐渐沮丧看到3.5和4.0的解决方案。原来你做同样的事情,你只需要几行添加到< ConfigSections> 标记你的web.config。它应该是当你把它粘贴到根目录下的第一个元素。

I had this same exact problem. Was getting frustrated seeing 3.5 and 4.0 solutions. Turns out you do the same thing, you just have to add a couple lines to the <ConfigSections> tag in your Web.config. It should be the first element under the root when you paste it in.

<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, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
            <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
                <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false"/>
            </sectionGroup>
        </sectionGroup>
    </sectionGroup>
</configSections>

然后添加在实际&LT; System.Web.Extensions程序&GT; 部分:

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

这篇关于JSON最大长度问题ASP.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆