My view page has a Model which is represented by a List of Students.
I want to pass that Model to a controller parameter:
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult SendMail(List<Student> students)
{
.............
return View("Success",students)
}
I tried this with an Ajax.ActionLink:
<%= Ajax.ActionLink("Send Mail to list AT SCS", "SendMail", students = Model,
new AjaxOptions()
{
Confirm = "Are you sure you want to send mails?",
HttpMethod = "POST"
}
)%>
But when I use the debugger in VS, I see that the List is empty. Is not possible to send a list to a controller from a view? If not, how do I solve this?