How can we make a checkbox checked or unchecked programatically based on the value? That is to say, for a particular user if the value is true, the checkbox should be checke
if(condition = true) { @Html.CheckBoxFor(x => x.Test, new { @checked = "checked" }) } else { @Html.CheckBoxFor(x => x.Test) }
Hope this helps :)