您的代码看起来不错,它应该可以工作。我刚刚在一个新应用程序中测试了以下内容,没有出现问题。
模型:
public class AddressInfo { public string Address1 { get; set; } public string Address2 { get; set; } public string City { get; set; } public string State { get; set; } public string ZipCode { get; set; } public string Country { get; set; }}控制器:
public class HomeController : Controller{ public ActionResult Index() { return View(); } [HttpPost] public ActionResult Check(AddressInfo addressInfo) { return Json(new { success = true }); }}视图:
<script type="text/javascript"> var ai = { Address1: "423 Judy Road", Address2: "1001", City: "New York", State: "NY", ZipCode: "10301", Country: "USA" }; $.ajax({ url: '/home/check', type: 'POST', data: JSON.stringify(ai), contentType: 'application/json; charset=utf-8', success: function (data) { alert(data.success); }, error: function () { alert("error"); } });</script>


