title: ASP.NET MVC: Render checkbox list from MultiSelectList
body: <p>How do you associate a MultiSelectList with a list of checkboxes?</p>
  
  <p>eg. I pass something like this to the model</p>
  
  <pre><code>  model.Groups = new MultiSelectList(k.Groups, "Id", "Name", selectedGroups)
  </code></pre>
  
  <p>How should I render it? This doesn't work</p>
  
  <pre><code>&lt;% foreach (var item in Model.Groups.Items) { %&gt;
    &lt;input type="checkbox" name="groups" value="&lt;%=item.Value%&gt;" id="group&lt;%=item.Value%&gt;" checked="&lt;%=item.Selected?"yes":"no"%&gt;" /&gt;
    &lt;label for="group&lt;%=item.Value%&gt;"&gt;&lt;%=item.Text%&gt;&lt;/label&gt;
  &lt;% } %&gt;
  </code></pre>
  
  <blockquote>
    <p>Error CS1061: 'object' does not contain a definition for 'Value'...</p>
  </blockquote>
  
  <p>Is there a HTML Helper method that I can use?</p>
  
  <p>(Then, unless it is straightforward, how should I then get the selected values back on the Controller when the form is submitted?)</p>