I have a strongly typed view displaying data from
ViewModel public class GoldSetnUsers { bool Public { get; set; } public List<GSUsers> gsUsers { get; set; } public GoldSetnUsers() { UsersContext _dbm = new UsersContext(); this.gsUsers = _dbm.UserProfiles.Select(n => new GSUsers { UserName = n.UserName, isEditor = false, isReviewer = false }).ToList(); } public class GSUsers { public string UserName { get; set; } public bool isEditor { get; set; } public bool isReviewer { get; set; } } }
Httpget controller method displays this view

The problem is that the post-back model returns all rows as flags. A checkbox outside the table, Public, returns the correct feedback value.
Controller Return Code
[HttpPost] public ActionResult Create(GoldSetnUsers newGS) { if (ModelState.IsValid) {
}
View
@model mvc2db.Models.GoldSetnUsers @using BootstrapSupport; @using (Html.BeginForm()) { @Html.ValidationSummary(true) @Html.BeginControlGroupFor(model=>model.Public) @Html.LabelFor(model => model.Public,new {@class="control-label"}) <div class="controls"> @Html.EditorFor(model => model.Public,new {@class="input-xlarge"}) @Html.ValidationMessageFor(model => model.Public,null,new{@class="help-inline"}) </div> <div class="controls"> <table class="table"> <thead> <tr> <th>Name</th> <th>Reviewer</th> <th>Editor</th> </thead> <tbody> @foreach (var item in Model.gsUsers) { <tr> <td> @Html.DisplayFor(modelItem => item.UserName) </td> <td> @Html.EditorFor(modelItem => item.isEditor) </td> <td> @Html.EditorFor(modelItem => item.isReviewer) </td> </tr> } </tbody> </table></div> @Html.EndControlGroup() <div class="form-actions"> <button type="submit" class="btn btn-primary">Save changes</button> <button class="btn">Cancel</button> </div> </fieldset> }
source share