Why is the CheckBoxList removed from ASP.NET MVC preview release 5?
Currently I don\'t see any way in which I can create a list of checkboxes (with similar nam
I recommend using JeremiahClark extension posted above. (CheckBoxList)
My controller resulted into very simple instructions. For clarify I add a fragment of my code that's absent in the sample.
var rolesList = new List();
foreach (var role in Roles.GetAllRoles())
{
rolesList.Add(new CheckBoxListInfo(role, role, Roles.IsUserInRole(user.UserName, role)));
}
ViewData["roles"] = listaRoles;
And in the view:
<%= Html.CheckBoxList("roles", ViewData["roles"]) %>
That's all.