title: How to do checkbox control in ASP.net Core
body: <pre><code>//Part of View
      &lt;div class="checkbox"&gt;
          &lt;label id="sendEmail" class="" &gt;
              &lt;input id="sendEmailInput" type="checkbox" asp-for="CompanySetting.SendEmail"&gt;Send mail for jobs.
          &lt;/label&gt;
      &lt;/div&gt;
  
  
  //Model
      public partial class CompanySetting
      {
          public int CompanyId { get; set; }
          public bool SendEmail { get; set; }
  
          public virtual CompanyUsers Company { get; set; }
      }
  //Controller
      public ActionResult AccountSettingSave(CompanyAccountViewModel model)
      {
          try
          {
              CompanySetting settingModel = _companySettingService.GetByCompanyId(GetId());
              settingModel.SendEmail = model.CompanySetting.SendEmail;
              _companySettingService.UpdateBill(settingModel);
              TempDataMessage("message", "Hesap ayarları başarıyla güncellendi.");
              return RedirectToAction("AccountSettings");
          }
          catch
          {
              TempDataMessage("message", "Hesap ayarları güncellenemedi.");
              return RedirectToAction("AccountSettings");
          }
  
      }
  </code></pre>
  
  <p>Checbox does not affect model, it is always default value. probably checkbox returns just on. but i tried with javascript + extra one input and works . i dont want use javascirpt control</p>