title: How can I pass multiple Json objects to ASP.net MVC controller?
body: <p>I would really appreciate a tip here... I've been looking for a solution for 4 hours now...</p>
  
  <p>I have a function like so:</p>
  
  <pre><code>public virtual JsonResult LoadPreviousProductsJson(SearchResultModel rmodel, SearchCriteriaModel cmodel)
  </code></pre>
  
  <p>I'm trying to send data to this controller like so:</p>
  
  <pre><code>var jsonData = $('#frmSearchResult').serialize();
  var stringToPost = JSON.stringify(jsonData);
  
  var jsonData2 = $('#frmSearchProducts').serialize();
  var stringToPost2 = JSON.stringify(jsonData2);
  
  
  $.post('@Url.Action(MVC.Product.LoadPreviousProductsJson())', { rmodel: stringToPost, cmodel: stringToPost2 })
      .done(function(data) {....
  </code></pre>
  
  <p>This results that the objects are Null in the controller...</p>
  
  <p>If I only send 1 Json objectI am succesfull:</p>
  
  <pre><code>$.post('@Url.Action(MVC.Product.LoadPreviousProductsJson())', stringToPost)
  .done(function(data) {....
  </code></pre>
  
  <p>but when I try to send them together, it Always fails...</p>
  
  <hr>
  
  <p>Only somewhat successful thing I can do is sending the 2 objects as string and read them with Newtonsoft, but here I can't convert the strings to the corresponding objects.... </p>
  
  <pre><code>model = Newtonsoft.Json.JsonConvert.DeserializeObject&lt;SearchResultModel&gt;(rmodel);
  model2 = Newtonsoft.Json.JsonConvert.DeserializeObject&lt;SearchCriteriaModel&gt;(cmodel);
  </code></pre>
  
  <p>The above code just fails...</p>