这是前端的代码:
var projectlist = ["1","2","3"];
var url = "<%=Url.Action("GetPrjectData","Home") %>";
var data = { "prjectIdlist": projectlist };
$.post(url, data, function (response) {
if (response.data != "error") {
console.log(response) ;
}
});
后端:
[HttpPost]
public ActionResult GetPrjectData()
{
var projectArray = Request["prjectIdlist"];
if (projectArray == null)
return Json(new {data = "error"});
return Json(new
{
data = list
});
}
前端我看过了,有值,但是到了后端就取不到了。