title: Pass list of ints from JavaScript to C# -- I get the list, but it is empty; form data isn't structured properly?
body: <p>I have my array populated like so:</p>
  
  <pre><code>updateLabels: function () {
      var diagrams = _stage.diagramLayer.getChildren();
  
      var componentIDs = new Array();
  
      for (var index = 0; index &lt; diagrams.length; index++) {
          componentIDs.push(diagrams[index].componentID);
      }
  
      var self = this;
      $.ajax({
          url: '../PlanView/UpdateDiagrams',
          type: 'POST',
          data: { ComponentIDs: JSON.stringify(componentIDs), RackInfo: $('#RackInfoSelect').val() },
          success: function (data) {
              console.log('success');
          },
          error: function () {
              console.log("error");
          }
      });
      },
  </code></pre>
  
  <p>server side I have this method:</p>
  
  <pre><code>[CompressionFilterAttribute]
  public JsonResult UpdateDiagrams(List&lt;int&gt; componentIDs, string rackInfo)
  {
      List&lt;object&gt; diagramInformation = new List&lt;object&gt;(componentIDs.Count());
  }
  </code></pre>
  
  <p>my data as it is being passed across the network:</p>
  
  <pre><code>ComponentIDs:[74,445,732,351,348,347,1123,599,600,1053,350,601,602,603,332,99,877,919,349,348,347,347,349,348]
  RackInfo:Equipment Weight
  </code></pre>
  
  <p>I successfully get RackInfo, if I change UpdateDiagrams to expect <code>List&lt;string&gt;</code> then I get a list with one item in it, the entire ComponentIDs string.</p>
  
  <p>What am I doing incorrectly here?</p>
  
  <p>EDIT: I am working under MVC3. I should be able to leverage some sort of automatic deserialization when passing to my controller, I am just not sure how.</p>
  
  <p>SOLUTION: The solution was to wrap my data object in JSON.stringify, not just componentIDs. Even though I can get the RackInfo variable server-side without converting it to JSON.</p>