【发布时间】:2015-07-24 15:29:06
【问题描述】:
将 Json 数组传递给返回 Null 的 MVC 控制器动作。
**controler***
public class TestData
{
public string name1 { get; set; }
public string value1 { get; set; }
}
public JsonResult MyMethod(List<TestData> testVal)
{
//testval object having name1 and value1 null values
}
查看页面
$.getJSON("/viewFolderName/MyMethod",
{
testVal: [{ name1: "veea", value1: "0" }]
},
function (data) {
//result
});
将 Json 数组传递给返回 Null 的 MVC 控制器动作
【问题讨论】:
-
以上链接解决方法不清楚
-
不要使用$.getJSON,而是使用$.ajax
标签: json asp.net-mvc asp.net-mvc-3 asp.net-mvc-4 getjson