![](/img/trans.png)
[英]MVC Error: The length of the string exceeds the value set on the maxJsonLength property
[英]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.