title: AJAX POST Data to MVC Controller in ASP.NET Core Always Null When Passing An Object Array Over a Certain Length
body: <p>I have a javascript function that is creating a model that includes an array of objects and sending that data to my MVC controller with an AJAX POST request. For some reason, it seems that there is a limit on the size of that array that can be passed to the controller though, which though experimentation, seems to be between 450 and 500 objects in my case. Once it's larger than that threshold, the controller will just receive a null value. Is there some configuration or workaround that can be done to remove or work around this limitation?</p>
  <p>I've already tried several web.config based &quot;solutions&quot; that a lot of people have proposed on similar SO questions to no avail (I think those may be applicable only for .Net Framework's version of ASP.NET, not .NET Core).</p>
  <p>Javascript:</p>
  <pre><code>var i = 0;
  $(&quot;#SupplierNumber option&quot;).each(function () {
      var supplierNumber = {};
      supplierNumber.Value = $(this).val();
      supplierNumber.text = $(this).val();
      supplierNumbers.push(supplierNumber);
      //Below limits max size for testing
      i = i + 1;
      if (i &gt; 450) {
          return false;
      }
  });
  
  //Other non-array values gathered here
  var model = {
      &quot;SupplierNumbers&quot;: supplierNumbers,
      //... other non-array values added to model
  }
  
  $.ajax({
      type: &quot;POST&quot;,
      url: &quot;/Administration/TestPost&quot;,
      data: model,
      dataType: &quot;json&quot;,
      success: function (data) {
          alert(&quot;Finished&quot;);
      }
  });
  </code></pre>
  <p>Controller:</p>
  <pre><code>[HttpPost]
  public async Task&lt;IActionResult&gt; TestPost(TestViewModel model)
  {
      //model is null here when array is &gt; 500 in size 
      return Json(new { success = true });
  }
  </code></pre>