exceeding maxJsonLength property问题-mvc4
2014-11-14 02:40
465 查看
问题:the length of the string exceeds the value set on themaxJsonLength property解决方案:step1: 在web.config里添加
[code]<configuration>[/code]
<system.web.extensions>
<scripting>
<webServices>
<jsonSerialization maxJsonLength="50000000"/>
</webServices>
</scripting>
</system.web.extensions>
</configuration>step2: 在controller里添加
[code]protected override JsonResult Json(object data, string contentType, System.Text.Encoding contentEncoding, JsonRequestBehavior behavior)[/code]{
[code] return new JsonResult()[/code]{
Data = data,ContentType=contentType,
ContentEncoding = contentEncoding,
JsonRequestBehavior = behavior,
MaxJsonLength = Int32.MaxValue};
}问题解决方案来源: http://stackoverflow.com/questions/1151987/can-i-set-an-unlimited-length-for-maxjsonlength-in-web-config http://stackoverflow.com/questions/1151987/can-i-set-an-unlimited-length-for-maxjsonlength-in-web-config/12278956#12278956
相关文章推荐
- JavaScriptSerializer.MaxJsonLength属性问题
- .NET MVC JSON JavaScriptSerializer 字符串的长度超过 maxJsonLength 值问题的解决
- The length of the string exceeds the value set on the maxJsonLength property
- JavaScriptSerializer.MaxJsonLength属性问题
- JavaScriptSerializer.MaxJsonLength属性问题
- The length of the string exceeds the value set on the maxJsonLength property
- .NET MVC JSON JavaScriptSerializer 字符串的长度超过 maxJsonLength 值问题的解决
- .net 使用Json(),maxJsonLength属性设置的值问题
- hive的Specified key was too long; max key length is 767 bytes问题解决
- Web MVC编程:The length of the string exceeds the value set on the maxJsonLength propert
- hive的Specified key was too long; max key length is 767 bytes问题解决
- hive的Specified key was too long; max key length is 767 bytes问题解决
- hive中Specified key was too long; max key length is 767 bytes问题解决
- hive的Specified key was too long; max key length is 767 bytes问题解决
- 解决遍历json时length找不到对象问题
- hive的Specified key was too long; max key length is 767 bytes问题解决
- mvc “使用 JSON JavaScriptSerializer 进行序列化或反序列化时出错,字符串的长度超过了为 maxJsonLength 属性设置的值” 解决经历
- Can i give unlimited length for maxJsonLength?
- hive的Specified key was too long; max key length is 767 bytes问题解决
- Json MaxJsonLength Error