首页 新闻 赞助 找找看

EasyUI Datagrid 无法post 125行以上的数据到后台

0
悬赏园豆:5 [已关闭问题] 关闭于 2015-10-23 10:14

【前台】

$("#btnExport").click(function () {
var rows = $("#List").datagrid("getRows"); 

$.ajax({
url: "/SysException/Export?sysExceptionModels",
data: JSON.stringify(rows), 
type: "POST",
contentType: 'application/json; charset=utf-8',
success: function (data) {
if (data.type == 1) {
$("#aExportExcel")[0].click(); 
$.messageBox5s('提示', data.message);
} else {
$.messageBox5s('提示', data.message);
}
}
});
});

 

【后台】

static List<SysExceptionModel> _sysExceptionModelModels = null;

[HttpPost]
public JsonResult Export(List<SysExceptionModel> sysExceptionModels)
{
_sysExceptionModelModels = sysExceptionModels;
if (_sysExceptionModelModels == null)
{
return Json(JsonHandler.CreateMessage(0, "没有数据,无法导出!"), JsonRequestBehavior.AllowGet);
}
else
{
return Json(JsonHandler.CreateMessage(1, "导出成功!"), JsonRequestBehavior.AllowGet);
}
}

 

 

【问题】

当在前台用“$("#List").datagrid("getRows")”获取到当前页面datagrid的行时,如果行数超过200,则无法传入到后台,请问什么原因?是由于JSON.stringify(rows)不能处理过大量的数据导致的吗?

 

add:一行的数据量如下:

0000688A-85F5-4F72-BE86-85BCADED2DEN ULL BBBB BBBB BBBB BBBB BBBB 2015-10-22 02:27:38.000

KevinGarnett的主页 KevinGarnett | 菜鸟二级 | 园豆:201
提问于:2015-10-22 14:16
< >
分享
所有回答(2)
-2

这个应该不会,我一起用easy获取的数据做个假分页,没有这个问题,这个也与easy没什么关系,你是用异步的ajax像后台传的

稳稳的河 | 园豆:4216 (老鸟四级) | 2015-10-22 16:05

You probably are exceeding the max serialization size. Try increasing the MaxJsonDeserializerMembers value in your web.config. Default value is 1000, which might be a bit too small. 150000 might be a better value:

<appSettings>

   <add key="aspnet:MaxJsonDeserializerMembers" value="150000" />

</appSettings>

设置一下aspnet:MaxJsonDeserializerMembers到150000就可以了,默认是1000,太小了。

支持(0) 反对(0) KevinGarnett | 园豆:201 (菜鸟二级) | 2015-10-23 10:10
0

You probably are exceeding the max serialization size. Try increasing the MaxJsonDeserializerMembers value in your web.config. Default value is 1000, which might be a bit too small. 150000 might be a better value:

<appSettings>

   <add key="aspnet:MaxJsonDeserializerMembers" value="150000" />

</appSettings>

设置一下aspnet:MaxJsonDeserializerMembers到150000就可以了,默认是1000,太小了。

KevinGarnett | 园豆:201 (菜鸟二级) | 2015-10-23 10:12
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册