我正在使用jQuery的自动完成功能.当我尝试检索超过17000条记录的列表(每条记录的长度不超过10条)时,它超出了长度并抛出错误:
异常信息:
异常类型:InvalidOperationException
异常消息:使用JSON JavaScriptSerializer进行序列化或反序列化时出错.字符串的长度超过maxJsonLength属性上设置的值.
我可以设置无限长度maxJsonLength的web.config?如果没有,我可以设置的最大长度是多少?
我正在使用ajax呼叫来获取车辆旅行详细信息。因此,当从控制器返回行程详细信息以查看时,出现了错误“字符串的长度超过了在maxjsonlength属性上设置的值”。
下面给出的是我用来获取行程详细信息的ajax调用。每当行程细节很大时,都会进入误差函数。
function LoadTripModalWindow(masterID, headwayPlanID, version, specialDay, applicableDay) {
//change this value after cpp service implementation
//version = 1;
/////////////////
if (headwayPlanID == 0 || headwayPlanID == null) {
$('#HeadwayPopUp').hide();
$('#NoTripGenerated').hide();
$('#NoHeadwayPopUp').show();
}
else {
$('#tripDialogDiv').hide();
$('#NoHeadwayPopUp').hide();
$.blockUI({ message: $('#msthrobber') });
var tripIn = '';
tripIn = '<table class="table table-bordered trip" id="tripInTableMS"> </table>';
$("#tripInTableMS").remove();
$("#TripIn").append(tripIn);
var tripOut = '';
tripOut = '<table class="table table-bordered trip" id="tripOutTableMS"> </table>';
$("#tripOutTableMS").remove();
$("#TripOut").append(tripOut);
$.ajax({
type: "GET",
url: "/ScheduleManagement/MasterConfiguration/GetTripTableDetails/",
data: { version: version, masterScheduleID: masterID, …Run Code Online (Sandbox Code Playgroud)