Put a checkBox as "checked" using an HTMLHelper

0

my question is short, in which part I must add the property of checked in my HTMLHelper , since I must show it by default as selected, I looked in the microsoft documentation but found nothing about it :(

so I tried to do it, but it did not work

 @Html.CheckBoxFor(model => model.Estatus, new { htmlAttributes = new { @checked = "checked" } })
    
asked by Adriana S. 20.07.2017 в 23:41
source

1 answer

0

Because you are assigning the model value (it is a CheckBoxFor), you should set the Status value to true in the controller before passing it to the view.

    
answered by 20.07.2017 / 23:45
source