Topic: I am having trouble with an MVC checkbox
sharpspoon free asked 4 years ago
Expected behavior I am attempting to use the "Remember Me" part of the following MDB code: https://mdbootstrap.com/snippets/jquery/temp/2288416?action=prism_export#html-tab-view
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 4 years ago
This code works for me with asp.net 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>
</div>
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- 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