It appears this has been fixed in MVC4.
You can do this, which worked well for me:
public ActionResult SomeControllerAction()
{
var jsonResult = Json(veryLargeCollection, JsonRequestBehavior.AllowGet);
jsonResult.MaxJsonLength = int.MaxValue;
return jsonResult;
}
More Related Contents:
- Error Handling in ASP.NET MVC
- Json and Circular Reference Exception
- ASP.NET MVC: Controlling serialization of property names with JsonResult
- Intermittent asp.net mvc exception: “A public action method ABC could not be found on controller XYZ.”
- How do I redirect a user to a custom 404 page in ASP.NET MVC instead of throwing an exception?
- How to get ELMAH to work with ASP.NET MVC [HandleError] attribute?
- Polymorphic model binding
- MVC DateTime binding with incorrect date format
- ASP.NET MVC ActionLink and post method
- ASP.Net MVC Html.HiddenFor with wrong value
- ASP.NET MVC – How to Preserve ModelState Errors Across RedirectToAction?
- How to make a catch all route to handle ‘404 page not found’ queries for ASP.NET MVC?
- Exception: Serialization of ‘Closure’ is not allowed
- Server cannot set status after HTTP headers have been sent IIS7.5
- AWS Elastic Beanstalk environment variables in ASP.NET Core 1.0
- How do you set the startup page for debugging in an ASP.NET MVC application?
- Entity Framework Include OrderBy random generates duplicate data
- How to handle DBContext when using Ninject
- How can I have lowercase routes in ASP.NET MVC?
- How does a method in MVC WebApi map to an http verb?
- Pass Model To Controller using Jquery/Ajax
- Is there any attribute relating to AJAX to be set for ASP.NET MVC controller actions?
- how to gzip content in asp.net MVC?
- Why is ValidateInput(False) not working?
- Html.DropDownList – Disabled/Readonly
- Inject repository to custom membership provider with Ninject
- Get ExtraData from MVC5 framework OAuth/OWin identity provider with external auth provider
- How to create a function in a cshtml template?
- Unable to get windows authentication to work through local IIS
- View Model IEnumerable property is coming back null (not binding) from post method?