I met a issue which is the Ajax could not post a more than 125 rows of data to the corresponding action in the ASP.NET MVC4. When the row count is less than 125, everything could be OK. So it's strange here.
[JS Ajax]
$("#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);
}
}
});
});
[ASP.NET MVC4]
static List<SysExceptionModel> _sysExceptionModelModels = null;
[HttpPost]
public JsonResult Export(List<SysExceptionModel> sysExceptionModels)
{
_sysExceptionModelModels = sysExceptionModels;
if (_sysExceptionModelModels == null)
{
return Json(JsonHandler.CreateMessage(0, "no data,could not export!"), JsonRequestBehavior.AllowGet);
}
else
{
return Json(JsonHandler.CreateMessage(1, "export sucessfully!"), JsonRequestBehavior.AllowGet);
}
}
one row is like below:
0000688A-85F5-4F72-BE86-85BCADED2DE NULL BBBB BBBB BBBB BBBB BBBB 2015-10-22 02:27:38.000