Quote:
<input type="checkbox" name="ISEnroled" ... value="@Model.ISEnroled" @ISEnroled />
You're setting the value of the checkbox to the current value from the model, which is
false
.
So even if you check the checkbox, when you submit the form, the value you're submitting is "false".
Use either the
CheckBox[
^] or
CheckBoxFor[
^] helpers to render the checkbox:
<div class="blog_form_input">
@Html.LabelFor(m => m.LoginName, "Login Name")
@Html.TextBoxFor(m => m.LoginName, new { @class = "name_input" })
<span id="errorLoginName" style="display:none"> <label style="color:red">You have to enter login name </label></span>
</div>
<div class="blog_form_input">
@Html.LabelFor(m => m.ISEnroled, "Enroll")
@Html.CheckBoxFor(m => m.ISEnroled, new { @class = "css-checkbox9 all_check" })
<label for="ISEnroled" class="css-label9" checked="checked"> </label>
</div>