title: MVC4 controller post multiple json objects to controller, ajax post
body: <p>is there any example to post multiple objects to a controller. How the data for the ajax post have to look like ?</p>
  
  <pre><code>[HttpPost]
  public string Register(UserLogin userLogin, Contact contact)
  {
  }
  </code></pre>
  
  <p><strong>UserLogin</strong>    </p>
  
  <pre><code>public class UserLogin 
  {
     public string Username { get; set; }
     public string Password { get; set; }
  }
  </code></pre>
  
  <p><strong>Contact</strong></p>
  
  <pre><code>public class Contact
  {
     public string Firstname { get; set; }
     public string Lastname { get; set; }
  }
  </code></pre>
  
  <p><strong>AJAX ?</strong></p>
  
  <pre><code>$.ajax({
     type: "POST",
     url: "SomeUrl"
     dataType: "json",
     contentType: "application/json; charset=utf-8",
     data: ? });
  </code></pre>