Hi,
I thought I'd post this solution here to an issue I was having regarding json strings being to large for return from an MVC endpoint using Kendo Grid and ajax/json/datasourceresult as per a grid (or listivew et al) Read endpoint for ajax:
Instead of doing the following (as per usual):
return Json(dataSourceResult);
use this instead:
return new JsonResult() {
Data = dataSourceResult,
ContentType = "application/json",
ContentEncoding = System.Text.Encoding.UTF8,
JsonRequestBehavior = JsonRequestBehavior.AllowGet,
MaxJsonLength = Int32.MaxValue
};
The solution above does not require any web.config changes et al.
Regards,
Rene Pilon
I thought I'd post this solution here to an issue I was having regarding json strings being to large for return from an MVC endpoint using Kendo Grid and ajax/json/datasourceresult as per a grid (or listivew et al) Read endpoint for ajax:
Instead of doing the following (as per usual):
return Json(dataSourceResult);
use this instead:
return new JsonResult() {
Data = dataSourceResult,
ContentType = "application/json",
ContentEncoding = System.Text.Encoding.UTF8,
JsonRequestBehavior = JsonRequestBehavior.AllowGet,
MaxJsonLength = Int32.MaxValue
};
The solution above does not require any web.config changes et al.
Regards,
Rene Pilon