【发布时间】:2013-10-07 21:26:46
【问题描述】:
我正在检索 JSON,但由于其长度有限 (2147483644),我收到此错误。
我怎样才能发现这个错误?
使用 JSON 进行序列化或反序列化时出错 JavaScript 序列化器。字符串长度超过设置的值 在 maxJsonLength 属性上。
这就是我现在的编码方式。
[HttpGet]
public JsonResult GetSearchData(string filter)
{
IRemediationService svc = new RemediationService();
var data = svc.SearchData(filter);
try{
return Json(data, JsonRequestBehavior.AllowGet);
}catch(Exception e){
return "Error";
}
}
【问题讨论】: