How do I configure Checkboxes in Asp.Net MVC Razor.
Since in the documentation we have the following configuration Materialize for checkboxes :
<p>
<label>
<input type = "checkbox" />
<span> Network </span>
</label>
</p>
And in Razor I could not perform this configuration.
<div class = "input-field col s12">
@Html.EditorFor (model => model.AnnualDestaque)
@Html.LabelFor (model => model.AnnualDestaque)
@Html.ValidationMessageFor (model => model.AnnualDestaque, "", new {@class = "text-danger"})
</div>
Please include model Name in your cshtml page
Model
You can make it work doing this:
I was able to solve it, and I am passing the answer.
I used Html Helper Documentation Html Helper MVC
It worked perfectly without mistakes the way it's meant to be.
If you just want to have a checkbox binded with your model like that :
Just use :