title: Getting value from CheckBox in asp.net mvc 5
body: <p>I am trying to get a CheckBox value from the view, however, even if i check the CheckBox it still returnse me "false".</p>
  
  <p>What am i doing wrong?</p>
  
  <pre><code>        [HttpPost]
          [ValidateAntiForgeryToken]
          public ActionResult Create([Bind(Include = "Id,ReaderId,BookId")] BookingViewModel bookingViewModel)
          {
              Booking booking = new Booking();
              if (ModelState.IsValid)
              {
                  var userId = User.Identity.GetUserId();
                  int readerId = db.Readers.Where(c =&gt; c.ApplicationUserId == userId).First().ReaderId;
  
  
  
  
                  booking.ReaderId = readerId;
                  booking.BookId = bookingViewModel.BookId;
  
  
                  db.Bookings.Add(booking);
  
                  bool value = bookingViewModel.IfWantEmail;
                  db.SaveChanges();
  
                  return RedirectToAction("ShowUserBookings");
              }
  
              ViewBag.BookId = new SelectList(db.Books, "BookId", "Title", booking.BookId);
  
              return View(booking);
          }
  </code></pre>
  
  <p><strong>And this is the code from my view:</strong></p>
  
  <pre><code>            &lt;dt&gt;
                  @Html.DisplayNameFor(model =&gt; model.IfWantEmail)
              &lt;/dt&gt;
  
              &lt;dd&gt;
                  @Html.CheckBoxFor(model =&gt; model.IfWantEmail)
              &lt;/dd&gt;           
  </code></pre>