Is there any way to send multiple objects to a controller using AJAX? What should the data for the ajax post look like?
[HttpPost]
public string Register(UserLogin userLogin, Contact contact)
{
}
UserLogin
public class UserLogin
{
public string Username { get; set; }
public string Password { get; set; }
}
Contact
public class Contact
{
public string Firstname { get; set; }
public string Lastname { get; set; }
}
AJAX ?
$.ajax({
type: "POST",
url: "SomeUrl"
dataType: "json",
contentType: "application/json; charset=utf-8",
data: ?
});