title: null values sent to controller after jQuery Post
body: <p>I have a bit of code where I'm trying to send a Viewmodel back to the controller using Ajax post.  If I write the code one way, it passes correctly, and another way it returns null or 0 values within the viewmodel.</p>
  
  <p>The way that works:</p>
  
  <pre><code>$(document).ready(function () {
          $(".boxItem").change(function (event) {
              var url = "/Search/GetBoxChangeInfo";
              $.post(url, @Html.Raw(Json.Encode(Model)), function (data) {
                  $("#column-1").html(data);
              });
          });
      });
  </code></pre>
  
  <p>And the way that returns null values:</p>
  
  <pre><code>$(document).ready(function () {
          $(".boxItem").change(function (event) {
              var url = "/Search/GetBoxChangeInfo";
              $.post(url, { json: @Html.Raw(Json.Encode(Model)) }, function (data) {
                  $("#column-1").html(data);
              });
          });
      });
  </code></pre>
  
  <p>i need to use it the second way because I need to also pass parameters back about the selected value and ID, so it will look something like:</p>
  
  <pre><code>$(document).ready(function () {
          $(".boxItem").change(function (event) {
              var str = $(this).attr('id');
              var num = $(this).val();
              var url = "/Search/GetBoxChangeInfo";
              $.post(url, { json: @Html.Raw(Json.Encode(Model)), id : str, selected : num  }, function (data) {
                  $("#column-1").html(data);
              });
          });
  });
  </code></pre>
  
  <p>My controller looks like this btw:</p>
  
  <pre><code>[HttpPost]
  public ActionResult GetBoxChangeInfo(EventViewModel json)
  { 
       //stuff
  }
  </code></pre>
  
  <p>EDIT - as requested, here is EventViewModel structure</p>
  
  <pre><code>[JsonObject(MemberSerialization.OptIn)]
  public class EventViewModel
  {
      public int EventNumber { get; set; }
      public List&lt;EventItemsViewModel&gt; EventItems { get; set; }
      public List&lt;LocationViewModel&gt; Locations { get; set; }
      public int StartLocationID { get; set; }
      public bool Outbound { get; set; }
      public List&lt;int&gt; SelectedEvents { get; set; }
      public List&lt;DurationsViewModel&gt; Durations { get; set; }
  }
  </code></pre>
  
  <p>Anyone know why this might be happening?  Is there a limit to home much can be sent to the controller this way - it is quite a complex viewmodel, so wondered if that could be someting to do with it.</p>
  
  <p>Thanks</p>