title: JavaScriptSerializer.MaxJsonLength exceeded. What's the best practice for handling this?
body: <p>I've got a large amound of data I'm sending down to the client using jQuery's $.ajax() function. I'm calling a method in a ASP.NET web service that returns the JSON data. Everything is great for most searches, but when I've got a large data set to return I run into a issue with the JavaScriptSerializer MaxJsonLength property. What's the best practice for handling this? I don't want to just arbitrarily set a max length. Can I set the MaxJsonLength in the web service if the data being returned is larger than the current max or should I re-write and send down chucks of data to the client?</p>
  
  <p>Here's the relevant snippet from the web service:</p>
  
  <pre><code>Dictionary&lt;string, object&gt; jsonValuePairs = new Dictionary&lt;string, object&gt;();
  //add some data to the dictionary...
  return System.Web.Script.Serialization.JavaScriptSerializer.Serialize(jsonValuePairs);
  </code></pre>