can I use it like this in View?
<%= Html.CheckBoxFor(user => user.Role, "Administrator")%>
and then just read a value of property in model if checkbox is checked:
string role = user.Role;
(role = "Administrator")
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In your model…
In your view…
Yes, you need to write raw HTML for this scenario. This will bind correctly with the MVC defaults. The default CheckBoxFox really only works well with True/False bindings. Something like
or