public class AddUserViewModel{ public int ProjectId { get; set; } public int[] userAccountIds { get; set; }}
然后调整您的控制器动作以将此视图模型作为参数:
[HttpPost]public ActionResult AddUsers(AddUserViewModel model){ ...}
最后调用它:
function sendForm(projectId, target) { $.ajax({ url: target, type: 'POST', contentType: 'application/json', data: JSON.stringify({ projectId: projectId, userAccountIds: [1, 2, 3] }), success: ajaxOnSuccess, error: function (jqXHR, exception) { alert('Error message.'); } });}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)