title: Should I Use Html.CheckBox or Html.CheckBoxFor?
body: <p>I have a view that will have data from text boxes and checkboxes posted back and saved to my db when the user hits submit.  When the view is first loaded, some text boxes are loaded with data from the db for the user, and I'd also like certain checkboxes to be pre-checked as well.  Here is what I've got so far in my Get method:</p>
  
  <pre><code>    //vm is an object of my ViewModel
      [HttpGet]
      public ActionResult AddOrganization(int peopleID = 0)
      {
          var peopleModel = db.People.Include("EmployeeContacts").Single(g =&gt; g.PeopleID == peopleID);
          var contactModel = db.EmployeeContacts.Include("People").Single(g =&gt; g.PeopleID == peopleID);
          vm.People = new People();
          vm.EmployeeContacts = new EmployeeContacts();
          vm.OrganizationsOptions = new OrganizationOptions();
  
          // grabs info from db to be populated in the view
          vm.People.NID = peopleModel.NID;
          vm.People.FirstName = peopleModel.FirstName;
          vm.People.LastName = peopleModel.LastName;
          vm.People.SID = peopleModel.SID;
          vm.EmployeeContacts.Email = contactModel.Email;
          vm.EmployeeContacts.PrimaryPhone = contactModel.PrimaryPhone;
  
          var list = new List&lt;AddOrganizationViewModel&gt;
          {
              new AddOrganizationViewModel{ID = 1, Name = "Admin", AdminChecked = true},
              new AddOrganizationViewModel{ID = 2, Name = "Breakdown Report", BreakdownReportChecked = true},
              new AddOrganizationViewModel{ID = 3, Name = "Favorites", FavoritesChecked = true},
              new AddOrganizationViewModel{ID = 4, Name = "Site Admin", SiteAdminChecked = false},
          };
  
          return View("../Setup/AddOrganization", vm);
      }
  </code></pre>
  
  <p>My ViewModel looks like this:</p>
  
  <pre><code>    public class AddOrganizationViewModel
      {
          public Music.Models.Organizations Organizations { get; set; }
          public Music.Models.People People { get; set; }
          public Music.Models.OrganizationOptions OrganizationsOptions { get; set; }
          public Music.Models.EmployeeContacts EmployeeContacts { get; set; }
          public int ID { get; set; }
          public string Name { get; set; }
          public bool AdminChecked { get; set; }
          public bool BreakdownReportChecked { get; set; }
          public bool FavoritesChecked { get; set; }
          public bool SiteAdminChecked { get; set; }
      }
  </code></pre>
  
  <p>And this is the part of my view that contains the checkboxes, but I'm not sure what I need to do here to link my ViewModel, Controller, and View together, since the view is expecting a type of AddOrganizationViewModel, I'm stuck on how to send in the list of checkboxes also.</p>
  
  <pre><code>@model Music.ViewModels.AddOrganizationViewModel
  
  @using (Html.BeginForm("AddOrganization", "AddOrganization")){
  @Html.AntiForgeryToken()
  &lt;legend&gt;OPTIONS&lt;/legend&gt;
  &lt;div&gt;
      @Html.Label("Features: Admin")
      @Html.CheckBoxFor(Model =&gt; Model.AdminChecked)
  &lt;/div&gt;
  &lt;div&gt;
      @Html.Label("Features: Breakdown Report")
      @Html.CheckBoxFor(Model =&gt; Model.BreakdownReportChecked)
  &lt;/div&gt;
  &lt;div&gt;
      @Html.Label("Features: Favorites")
      @Html.CheckBoxFor(Model =&gt; Model.FavoritesChecked)
  &lt;/div&gt;
  &lt;div&gt;
      @Html.Label("Features: Site Admin")
      @Html.CheckBoxFor(Model =&gt; Model.SiteAdminChecked)
  &lt;/div&gt;
  }
  </code></pre>
  
  <p>Edit: updated code to reflect changes I've made using CheckBoxFor.</p>