Read More Ninja Action!

Method Error 500 - Maximum Length Exceeded with AJAX

I have ASP.NET application where I'm using jQuery to return data from the server all AJAX like. Next thing you know, my AJAX method is blowing up on me saying "Method Error 500 - Maximum Length Exceeded."

Naturally, I freak the fuck out and start stressing. I'm thinking that I can't return the amount of JSON data that my users need. But thankfully this one is a quick fix.

If you go into your web.config file you will notice a section called <system.web.extensions> which contains a sexy little node named "jsonSerialization." By implementing the logic below, you can quickly increase the maximum size limit of your AJAX queries.

It would of course be nice if Microsoft slapped a unit on there; for my measure I increased mine to 50000 donkeys.