【发布时间】:2014-11-28 04:10:00
【问题描述】:
可能重复Passing A List Of Objects Into An MVC Controller Method Using jQuery Ajax
但我的问题是我什么时候通过
var things = [
{employee:'test',effectiveDate:'',expirationDate:'' },
{ employee:'test',effectiveDate:'',expirationDate:'' }
];
$.ajax({
contentType: 'application/json',
type: "POST",
url: "/MyController/CheckMethod",
dataType: "json",
data: JSON.stringify(things),
async: false,
success: function (data) {
到[HTTPPOPST] JsonResult 的控制器方法,然后我将value 放入我的List<MYMODEL>
但是当我将控制器方法设为'ActionResult' 时,我在List<MYMODEL> 中得到null
为什么有什么不对?
【问题讨论】:
-
在
JsonResult和ActionResult两种类型的控制器方法中对我来说都很好。显示两个控制器方法?
标签: c# jquery ajax asp.net-mvc asp.net-mvc-4