title: ASP.Net MVC - Handle Multiple Checkboxes
body: <p>Ok, I have a role based permission system in place and would like admin's to be able to edit the permissions for each role. To do this I need to load lots of checkboxes, however I'm struggling with getting the return data from the View </p>
  
  <p>Please Note: I have looked around, I have found similar questions but as of yet cannot find a solution.</p>
  
  <pre><code> &lt;%
       Html.BeginForm();
  
      string lastGroup = "";
      foreach (var CurPermission in Model)
      {
  
  %&gt;
          &lt;%=Html.CheckBox("Permissions", CurPermission.Checked, new { ID = CurPermission.PermissionId}) + " " + CurPermission.PermissionValue%&gt; 
  
          &lt;br /&gt;
  &lt;%
      } 
      %&gt;
          &lt;input type="submit" value="Submit" /&gt;
      &lt;%
      Html.EndForm();
  %&gt;
  </code></pre>
  
  <p>and the controller, </p>
  
  <pre><code>[AcceptVerbs(HttpVerbs.Post)]
          public ActionResult EditPermissions(String[] Permissions)
          {
              foreach (var CurPermission in Permissions)
              {
                  Debug.WriteLine(CurPermission);
              }
  
              return View();
          }
  </code></pre>
  
  <p>Obviously I need to know which boxes are not checked as well as the ones that are. But in the return values because of the whole ("true,false") I cant work out which value relates to which checkbox.</p>
  
  <p>Any suggestions as to a fix or prehaps an alternate method would be appriciated.</p>