I made an asp.net website, but the checkbox is always false. Why is this so?
Model:
public string Username { get; set; }
public string Password { get; set; }
public bool Remember { get; set; }
CSHTML:
<div class="form-group">
@Html.Label("Remember me?")
@Html.CheckBoxFor(m => m.Remember)
</div>
The Remember
property is always false, if the checkbox is checked then Remember
is still false.