title: Multiple checkboxes in razor (using foreach)
body: <p>I have a problem and I can't find solution.
  I'm using Razor and it is my VieModel class.</p>
  
  <pre><code>public class GroupToExport
  {
      public GroupToExport()
      {
          ToExport = false;
      }
  
      [DisplayName("Export")]
      public bool ToExport { get; set; }
      public Group Group { get; set; }
  
  }
  
  public class GroupsToExport
  {
      public GroupsToExport()
      {
          //refill list
      }
  
      public List&lt;GroupToExport&gt; ExportingGroups { get; set; }
  }
  </code></pre>
  
  <p>View:</p>
  
  <pre><code>@using (Html.BeginForm("Export", "ElmahGroup", FormMethod.Post, new { id = "toExportForm" }))
  {
  //some divs
      &lt;input type="submit" id="js-export-submit" value="Export" /&gt;
   @foreach (var item in Model.ExportingGroups)
                  {
                      &lt;tr&gt;
                          &lt;td class="js-export-checkbox"&gt;
                              @Html.CheckBoxFor(modelItem =&gt; item.ToExport)
                          &lt;/td&gt;
                      &lt;/tr&gt;
                  }
  //some divs
  }
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>public ActionResult Export(GroupsToExport model)
      {
          var groupsToExport = model.ExportingGroups.Where(x =&gt; x.ToExport).Select(x =&gt; x);
          throw new System.NotImplementedException();
      }
  </code></pre>
  
  <p>After submit "ToExport", in Controller, every group always has value 'false'. Even if all groups are checked.</p>
  
  <p>Can somebody help me? What I'm doing wrong? </p>