繁体   English   中英

字符串的长度超过在maxJsonLength属性上设置的值

[英]The length of the string exceeds the value set on the maxJsonLength property

使用JSON JavaScriptSerializer进行序列化或deserialization序列化时出错。 字符串的长度超过了在maxJsonLength属性上设置的值。

<script type="text/javascript">
  function pageLoad(sender, e) {
    var Indexproductgroup = $get('<%=cboproductgroup.ClientID %>').selectedIndex;
    var Selectedproductgroup = $get('<%=cboproductgroup.ClientID   %>').options[Indexproductgroup].value;

    var q = $find("autoCompleteBehavior2");
    q.add_populating(function() {
      q.set_contextKey(Selectedproductgroup);
    });
  }
</script>

在web.config中,必须将maxJsonLength属性设置为更高的值。

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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