Topic: I am having trouble with an MVC checkbox

sharpspoon free asked 3 years ago

Expected behavior I am attempting to use the "Remember Me" part of the following MDB code:

Actual behavior the checkbox is not showing on the HTML view when using the CheckBoxFor. I need this to retreive the value for the model: @Html.CheckBoxFor(m => m.RememberMe) Remember me

Resources (screenshots, code snippets etc.)

vonmonckl free answered 3 years ago

This code works for me with 2 and above

<div class="form-check">
         <input type=checkbox asp-for="Input.RememberMe" class="form-check-input" id="checkRemember">
         <label class="form-check-label" asp-for="Input.RememberMe" for="checkRemember"></label>

sharpspoon free commented 3 years ago

this is for MVC, not ASP

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.19.1
  • Device: desktop
  • Browser: chrome
  • OS: windows
  • Provided sample code: No
  • Provided link: Yes