mvc JSON JavaScriptSerializer 进行序列化或反序列化时出错。字符串的长度超过了为 maxJsonLength 属性设置的值。
报错代码为 jsonObj过大
public ActionResult GetColumn(string table)
{
object jsonTreeObj = _fileBll.GetColumnBll(TableName);
return Json(JsonRequestBehavior.AllowGet, BaseResult.STATUS_SUCCESS, jsonObj);
}
修改:
var jsonResult = Json(JsonRequestBehavior.AllowGet, BaseResult.STATUS_SUCCESS, jsonObj);
jsonResult.MaxJsonLength = int.MaxValue;
return jsonResult;
浙公网安备 33010602011771号