asp.net mvc post list
action定义如下:
[HttpPost]
public ActionResult TestAction(List<testmodel> models){.....}
testmodel定义如下:
public class testmodel
{
public string A { get; set; }
public string B { get; set; }
}
js:
$.post("/Actions/TestAction",{models:[{A:"abcd",B:"eeef"},{A:"333",B:"2015"}]},function(a){console.log(a)});
服务器端跟踪到有两条数据,但是A和B都为null, 咋回事呢, 是不是json格式不对啊, 大哥些帮帮忙看看