Please tell me best way of return max Json result in ASP.NET MVC.
Currently I am using:
return Json(jsonData,JsonRequestBehavior.AllowGet);
In this case, if a method return max size of Json then Ajax throws an error. For this error I use this solution.
var jsonResult = Json(jsonData, JsonRequestBehavior.AllowGet);
jsonResult.maxJsonLength = int.MaxValue;
return jsonResult;
But I have a problem with this solution. If we use this solution, then my response takes more time so please tell me quick and fast solution of this problem.