title: How to get the selected checkbox value in post action in mvc 2
body: <p>I have got a checkbox list populated from database , I want to get the ID of each checkbox list during post action so that I can save that in the db , Below is the Code : 
  Controller:</p>
  
  <pre><code>  public ActionResult Create()
      {
          ITrackdayRepository trackdayResp = new TrackdayRepository();
          IQueryable&lt;Object&gt; getAllEvents = trackdayResp.GetEventsSelectlist();
          var m = new SelectList(getAllEvents,"ID","Name");
          ViewData["events"] = new SelectList(getAllEvents.ToList(), "EventID","Date");
          return View();
      } 
  
      //
      // POST: /Admin/Voucher/Create
  
      [HttpPost]
      public ActionResult Create(FormCollection collection)
      {
          try
          {
              // Get all the selected checkboxlist, do db insertion
  
              return RedirectToAction("Index");
          }
          catch
          {
              return View();
          }
      }
  </code></pre>
  
  <p>View</p>
  
  <pre><code>&lt;label&gt;Events&lt;/label&gt;
          &lt;/td&gt;
          &lt;td&gt;
           &lt;% foreach (var item in (SelectList)ViewData["events"]) { %&gt;
                   &lt;input type="checkbox" name="Name" value="&lt;%=item.Value %&gt;" /&gt;
                    &lt;label for="&lt;%=item.Value%&gt;"&gt;&lt;%=item.Text%&gt;&lt;/label&gt;
                    &lt;br /&gt;
  
          &lt;% } %&gt;  
          &lt;/td&gt;
  </code></pre>
  
  <p>I want to pass selected  &lt;%=item.Value %> of the checkbox list to the post aqction of create , so that i can save it like 1,2,3,4 .</p>