title: Retrieve a list of Checked Checkbox items in ASP .NET MVC 5?
body: <p>Following the Getting Started With EF Contoso University Tutorial: <a href="http://www.asp.net/mvc/overview/getting-started/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application" rel="nofollow">http://www.asp.net/mvc/overview/getting-started/getting-started-with-ef-using-mvc/creating-an-entity-framework-data-model-for-an-asp-net-mvc-application</a>
  I'm attempting to add a checkbox for each Student on the Students/Index page. But how do you retrieve the list of checked Student entities in the StudentController/Index() Action?</p>
  
  <pre><code>Views/Student/Index.cshtml:
  
  @model IEnumerable&lt;ContosoUniversity.Models.Student&gt;
  
  @{
      ViewBag.Title = "Index";
  }
  
  &lt;h2&gt;Index&lt;/h2&gt;
  @using (Html.BeginForm())
  {
      &lt;p&gt;
          Find by name: @Html.TextBox("SearchString")
          &lt;input type="submit" value="Search" /&gt;
      &lt;/p&gt;
  }
  &lt;p&gt;
      @Html.ActionLink("Create New", "Create")
  &lt;/p&gt;
  &lt;table class="table"&gt;
      &lt;tr&gt;
          &lt;th&gt;
              Selected
          &lt;/th&gt;
          &lt;th&gt;
              @Html.ActionLink("Last Name", "Index", new { SortOrder = ViewBag.NewLastNameSortParm })
          &lt;/th&gt;
          &lt;th&gt;
              @Html.ActionLink("First Name", "Index", new { SortOrder = ViewBag.NewFirstNameSortParm })
          &lt;/th&gt;
          &lt;th&gt;
              @Html.ActionLink("Enrollment Date", "Index", new { SortOrder = ViewBag.NewDateSortParm })
          &lt;/th&gt;
          &lt;th&gt;&lt;/th&gt;
      &lt;/tr&gt;
  
  @foreach (var item in Model) {
      &lt;tr&gt;
          @using (Html.BeginForm())
          {
              &lt;p&gt;
                  @Html.CheckBox("SelectStudent", false)
                  //Is this the correct format to instantiate a CheckBox?
              &lt;/p&gt;
          }
          &lt;td&gt;
              @Html.DisplayFor(modelItem =&gt; item.LastName)
          &lt;/td&gt;
          &lt;td&gt;
              @Html.DisplayFor(modelItem =&gt; item.FirstMidName)
          &lt;/td&gt;
          &lt;td&gt;
              @Html.DisplayFor(modelItem =&gt; item.EnrollmentDate)
          &lt;/td&gt;
          &lt;td&gt;
              @Html.ActionLink("Edit", "Edit", new { id=item.ID }) |
              @Html.ActionLink("Details", "Details", new { id=item.ID }) |
              @Html.ActionLink("Delete", "Delete", new { id=item.ID })
          &lt;/td&gt;
      &lt;/tr&gt;
  }
  
  &lt;/table&gt;
  
  Controllers/StudentController.cs:
  namespace ContosoUniversity.Controllers
  {
  public class StudentController : Controller
  {
      private SchoolContext db = new SchoolContext();
  
      // GET: Student
      public ActionResult Index(bool SelectStudent)
      {
         //How do I retrieve list of Selected Student Entities??
         return View(students.ToList());
      }
   }
  }
  </code></pre>