Topic: Checkbox is AWOL in ASP.NET MVC when using CheckBoxFor due to hidden input.
Ryan Ternier asked 8 years ago
howie418 pro answered 8 years ago
brijesh@njit.edu commented 6 years ago
this solution worked for me, thanks.
I wish MDB should have fixed it by now.
TyronSmith pro premium priority commented 5 years ago
Thank you, this works great!
Bartłomiej Malanowski staff pro premium answered 8 years ago
Ryan Ternier answered 8 years ago
Ryan Ternier answered 8 years ago
Bartłomiej Malanowski staff pro premium answered 8 years ago
howie418 pro answered 8 years ago
Bartłomiej Malanowski staff pro premium answered 8 years ago
Multinerd answered 7 years ago
It appears this has not been fixed yet. in MDB 4.5.0 and the js provided above does not work.
Heres a 'MvcHtmlString ' extension im using the works
https://gist.github.com/multinerd/21debdc7a9278049c82ae8078e1b148b
just replace
@Html.CheckBoxFor(m => m.RememberMe, new { @class = "form-control validate", id = "loginform-rememberme" })
with
@Html.BasicCheckBoxFor(m => m.RememberMe, new { @class = "form-control validate", id = "loginform-rememberme" })
rhubka answered 6 years ago
using System; using System.Web.Mvc; using System.Linq.Expressions; using System.Web.Mvc.Html;
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Resolved
- User: Free
- Premium support: No
- Technology: General Bootstrap questions
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No