Setting the Checked property of a CheckBox in ASP.NET MVC
问题 I'm trying to work around the lack of a CheckBoxList in ASP.NET MVC. I've gotten to the point I can render a list of Enum values just fine, but I'm stuck on how to set the checked attribute based on my Model - Which in this case is a User entity that has an IList of Role entities. The role id's correspond to the enum values. This example is using the Spark View Engine syntax, but it's functionally identical to the standard ASP.NET MVC view engine ("$(" is the same as "<%=" or "<%") <for each=