Guest User

Untitled

a guest
Sep 14th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. Custom List property not being updated from MVC View
  2. public List<MarketingModel> Marketing { get; set; }
  3.  
  4. this.Marketing = new List<MarketingModel>();
  5.  
  6. @foreach (MarketingModel m in Model.Marketing)
  7. {
  8.  
  9. <td class="title">@Html.DisplayFor(model => m.Name)</td>
  10. <td>@Html.CheckBoxFor(model => m.Mail)</td>
  11. <td>@Html.CheckBoxFor(model => m.Email)</td>
  12.  
  13. }
  14.  
  15. @for (int i = 0; i < Model.Marketing.Count; i++)
  16. {
  17. <td class="title">@Html.DisplayFor(model => Model.Marketing[i].Name)</td>
  18. <td>@Html.CheckBoxFor(model => Model.Marketing[i].Mail)</td>
  19. <td>@Html.CheckBoxFor(model => Model.Marketing[i].Email)</td>
  20. }
Add Comment
Please, Sign In to add comment