title: Why is my JSON string being truncated after ajax post in MVC 4.5?
body: <p>In one of my views in MVC 4.5 I have a jquery function that performs an ajax post to one of my controller methods. My data is 'stringified' json. For some reason, my controller method always limits my string lengths to 5325 characters. Once the string is sent to the controller, the application throws an error, because the JSON string isn't properly ended.</p>
  
  <p>This is my jquery function:</p>
  
  <pre><code>$(function () {
          $button.click(function () {
              var selected = JSON.stringify($table.bootstrapTable('getSelections'));
              $.ajax({
                  type: 'POST',
                  url: '/Hub/downloadWorkspaces',
                  data: 'selectedSpaces=' + selected,
                  success: function () {
                      window.location = '/Hub/browserMultiDownload';
                  }
              });
          });
      });
  </code></pre>
  
  <p>The data is sent to one of my controller methods which is shown below:</p>
  
  <pre><code>    [HttpPost]
      public void downloadWorkspaces(string selectedSpaces)
      {
          System.Diagnostics.Debug.WriteLine(selectedSpaces);
          JArray select = JArray.Parse(selectedSpaces);
  
          for (int i = 0; i &lt; select.Count; i++)
          {
              string selectedTest = select[i]["Workspace ID"].ToString();
              Hub.Models.Query.getAllFiles(selectedTest);
          }
      }
  </code></pre>
  
  <p>For some reason, the selectedSpaces string is always cut off. What can I do to fix this?</p>
  
  <pre><code>...,"_Workspace ID_data":{"field":"Workspace ID"},"name":"CM.02.0002.MASPA_Conditional    //No closing brace
  </code></pre>