I\'m rather new to the ASP.net MVC world and I\'m trying to figure out how to render a group of checkboxes that are strongly typed to a view model. In webforms I would just use
For me this works too, and I think this is the simplest (reading the previous answers).
The viewmodel has a string[] for the check boxes.
public string[] Set { get; set; }
The view has this code, and you can repeat the input as many times you need. name, id of the input control has to match the name of the property of the viewmodel.
Set
On the post method the Set variable is an array, having the checked value(s).