Post JavaScript array with AJAX to asp.net MVC controller

前端 未结 6 2185
长情又很酷
长情又很酷 2020-12-01 12:23

My controller:

[HttpPost]
public ActionResult AddUsers(int projectId, int[] useraccountIds)
{
    ...
}

I\'d like to post the parameters to

6条回答
  •  Happy的楠姐
    2020-12-01 12:57

    It won't work unless you specify that the ajax request (Post/Get) has the property traditional is set to true. Please refer to this question for more details.

提交回复
热议问题