All I want to know is the proper syntax for the Html.CheckBoxFor
HTML helper in ASP.NET MVC.
What I'm trying to accomplish is for the check-box to be initially checked with an ID value so I can reference it in the Controller to see if it's still checked or not.
Would below be the proper syntax?
@foreach (var item in Model.Templates)
{
<td>
@Html.CheckBoxFor(model => true, item.TemplateId)
@Html.LabelFor(model => item.TemplateName)
</td>
}