How to pass IEnumerable list to controller in MVC including checkbox state?
问题 I have an mvc application in which I am using a model like this: public class BlockedIPViewModel { public string IP { get; set; } public int ID { get; set; } public bool Checked { get; set; } } Now I have a View to bind a list like this: @model IEnumerable<OnlineLotto.Web.Models.BlockedIPViewModel> @using (Html.BeginForm()) { @Html.AntiForgeryToken() } @foreach (var item in Model) { <tr> <td> @Html.HiddenFor(x => item.IP) @Html.CheckBoxFor(x => item.Checked) </td> <td> @Html.DisplayFor