title: Asp.Net Mvc Checkbox list
body: <p>I'm implementing check box list in MVC, although I succeed to get the desired result, I have a doubt in my approach:</p>
  
  <pre><code>public class AdditionalServicesModel
  {
      public IList&lt;SelectListItem&gt; AdditionalServices { get; set; }
  }
  </code></pre>
  
  <p>=========================================================================</p>
  
  <pre><code>public class HomeController : Controller
  {
      //
      // GET: /Home/
  
      public ActionResult Index()
      {
          AdditionalServicesModel objAdditionalServicesModel = new AdditionalServicesModel();
  
          List&lt;SelectListItem&gt; services = new List&lt;SelectListItem&gt;();
          services.Add(new SelectListItem { Text = "service-1", Value = "1", Selected=false });
          services.Add(new SelectListItem { Text = "service-2", Value = "2", Selected=false });
          services.Add(new SelectListItem { Text = "service-3", Value = "3", Selected=false });
          objAdditionalServicesModel.AdditionalServices = services;
  
          return View(objAdditionalServicesModel);
      }
  
      [HttpPost]
      public ActionResult Index(AdditionalServicesModel result)
      {
          return RedirectToAction("Thanks", "Home");
      }
  
      public ActionResult Thanks()
      {
          return View();
      }
  }
  </code></pre>
  
  <p>=========================================================================</p>
  
  <pre><code>@model checkboxes.Models.AdditionalServicesModel
  @{
      ViewBag.Title = "Index";
      Layout = null;
  }
  
  
  @using (Html.BeginForm("Index", "Home", FormMethod.Post))
  {
      for (int i = 0; i &lt; Model.AdditionalServices.Count; i++)
      {        
          &lt;ul&gt;
              &lt;li&gt;
                  @Html.CheckBoxFor(m=&gt;Model.AdditionalServices[i].Selected, new { id = "Chk-" + i})
                  @Html.Label(Model.AdditionalServices[i].Text, new { @for = "Chk-" + i })
                  @Html.HiddenFor(m =&gt; Model.AdditionalServices[i].Text)
                  @Html.HiddenFor(m=&gt; Model.AdditionalServices[i].Value)
              &lt;/li&gt;
          &lt;/ul&gt;
      }
      &lt;input type="submit" value="POST to Controller" /&gt;
  }
  </code></pre>
  
  <p>1) For one checkbox I should create 2 additional hidden fields.
  Is there a better approach? I feel like it just wrong to make all this long way just to send checkboxes values + names, It would be much easier to collect its values with  javascript and send it via Json, but then I will not have an unobtrusive validation...</p>
  
  <p>2) I send all check boxes while I need to send only selected boxes.
  Is there a way to do it with forms post?</p>