title: How do I map checkboxes onto MVC model members?
body: <p>I have an MVC view</p>
  
  <pre><code>&lt;%@ Page Language="C#" MasterPageFile="PathToMaster" Inherits="System.Web.Mvc.ViewPage&lt;ModelData&gt;" %&gt;
  </code></pre>
  
  <p>and I have a form with HTML markup for a set of checkboxes:</p>
  
  <pre><code>&lt;label for="MyCheckbox"&gt;Your choice&lt;/label&gt;
  &lt;input type="checkbox" id="Option1" class="checkbox" name="MyCheckbox" value="Option one" /&gt;
  &lt;label for="Option1"&gt;Option one&lt;/label&gt;&lt;br /&gt;
  &lt;input type="checkbox" id="Option2" class="checkbox" name="MyCheckbox" value="Option two" /&gt;
  &lt;label for="Option2"&gt;Option two&lt;/label&gt;&lt;br /&gt;
  </code></pre>
  
  <p>and I have a controller-action pair</p>
  
  <pre><code>class MyController : Controller {
      [AcceptVerbs(HttpVerbs.Post)]
      public ActionResult RequestStuff( ModelData data )
      {
      }
  }
  </code></pre>
  
  <p>and that action is invoked when the form is submitted.</p>
  
  <p>How do I map the checkboxes onto members of <code>ModelData</code> (and what members I have to add to <code>ModelData</code>) so that when the form is submitted <code>data</code> stores information on which checkboxes are checked?</p>