I have an ASP.NET MVC 4 application. My application has a razor view that works with a list as a model.
@model List<MeetingLog.Models.UserModel> @{ Layout = null; } . . .
I repeat the Model variable as follows:
@foreach (var item in Model) { <tr> <td> @item.Name </td> <td> @item.Surname </td> <td> @Html.ActionLink("Click", "SavePerson", "Meeting", new {model = item, type = "coordinator"}, null) @Html.ActionLink("Click", "SavePerson", "Meeting", new {model = item, type = "participant"}, null) </td> </tr> }
I need to pass two variables to a SavePerson action with valid references. The first is the current UserModel, and the second is a string variable named type. But in my action, the first parameter appears as null. But the string parameter is doing the right thing. How can i achieve this?
source share