title: How to set the maxJsonLength property?
body: <p>I have a JsonResult returning 29833 records, of a CustomerID and a CustomerName. I am trying to load this into an AutoComplete, but I keep getting this error. </p>
  
  <blockquote>
    <p>Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.</p>
  </blockquote>
  
  <p>I did some digging around on the subject and came across this link <a href="https://stackoverflow.com/questions/1151987/can-i-set-an-unlimited-length-for-maxjsonlength-in-web-config">here</a>
  <br/>So I read over it and the answer provided didn't work out for me and then the next suggestion looked promising until I looked more at the code and came to the conclusion that it won't work for me because I am using JQuery Ajax to get the JsonResult. Now I am not sure what to do, here is the JQuery that I am using</p>
  
  <pre><code>function LoadCustomers() {
      $.ajax({
          type: "GET",
          url: "/Test/GetAllCustomers",
          dataType: "json",
          contentType: "application/json; charset=utf-8",
          success: function (data, textStatus, jqXHR) {
              ShowCustomers(data);
          }
      });
  }
  
  function ShowCustomers(custdata) {
      $("#acCustomers").kendoAutoComplete({
          dataSource: custdata,
          filter: "startswith",
          placeholder: "Select Customer...",
          dataTextField: "CustomerName"
      });
  }
  </code></pre>
  
  <p>I even tried just populating a grid but to no avail. Any idea's on how I can get this to work properly going about it the way I am going about it? I think as a last resort I would have to change my stored procedure around and pass in characters on every keyup event, I don't know if that would be a good idea or maybe it is, I don't know. Either way I sure could use some help or direction</p>
  
  <p><strong>EDIT</strong>
  The reason that this is not a duplicate based on the supplied link is because I am not working server-side, I am working Client-Side.</p>
  
  <p><strong>EDIT 2</strong></p>
  
  <p>Here is my JsonResult</p>
  
  <pre><code>public JsonResult GetAllCustomers(string name)
      {
          PGDAL dal = new PGDAL();
          List&lt;Customer&gt; lst = dal.GetAllCustomers();            
  
          return Json(lst, JsonRequestBehavior.AllowGet);
      }
  </code></pre>