web method:
<WebMethod()>
Public Shared Function Pcpacking() As IEnumerable(Of Packing)
Dim db As New STOREEntities
Return db.PC_PACKING_HISTORIES. _
Where(Function(q) q.PACK_DATE > "1388/11/07"). _
Select(Function(q) New Packing _
With {.Packdate = q.PACK_DATE,
.Packserialnumber = q.PACK_SERIAL_NUMBER,
.Netweight = q.NET_WEIGHT,
.Packusername = q.PACK_USER_NAME}).ToList()
End Function
script:
$(function () {
$("#grid").kendoGrid({
height: 200,
columns: [
{ field: "Packserialnumber", width: "150px" },
{ field: "Netweight", width: "50px" },
{ field: "Packusername", width: "150px" },
{ field: "Packdate", width: "100px" }
],
editable: false,
dataSource: {
schema: {
data: "d",
model: {
id: "Packserialnumber",
fields: {
Packserialnumber: { editable: false, nullable: true },
Netweight: { type: "number", validation: { required: true, min: 1} },
Packusername: { validation: { required: true} },
Packdate: { validation: { required: true} }
}
}
},
batch: false,
transport: {
read: {
url: "Default.aspx/Pcpacking",
contentType: "application/json; charset=utf-8",
type: "POST"
}
}
}
});
});
with this condition (PACK_DATE> "1388/11/07" 366 records ) everything works well. But when I change the date to 1388/11/06 1260 records or 1388/11/05 5460 records or ... the following error occurs:
{ "": " JSON JavaScriptSerializer. maxJsonLength.", "StackTrace": "at System.Web.Script.Serialization.JavaScriptSerializer. (Object obj, StringBuilder, SerializationFormat serializationFormat)\\ System.Web.Script.Serialization.JavaScriptSerializer.Serialize( OBJ, SerializationFormat serializationFormat)\r\n System.Web.Script.Services.RestHandler.InvokeMethod(HttpContext , WebServiceMethodDataData, IDictionary`2 rawParams)\r\n
System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext , WebServiceMethodData methodData)", "ExceptionType": "System.InvalidOperationException" }
, - . ?
.