有没有将多个对象发布到控制器的示例。ajax 帖子的数据看起来如何?
[HttpPost]
public string Register(UserLogin userLogin, Contact contact)
{
}
用户登录
public class UserLogin
{
public string Username { get; set; }
public string Password { get; set; }
}
接触
public class Contact
{
public string Firstname { get; set; }
public string Lastname { get; set; }
}
阿贾克斯?
$.ajax({
type: "POST",
url: "SomeUrl"
dataType: "json",
contentType: "application/json; charset=utf-8",
data: ? });