cshtml: The red part is the field using the method PostNextDay
<div id="postNextDay" class="col-xs-12 col-sm-6 col-md-4"> <div class="form-group checkbox"> @Html.CheckBoxFor(m => m.PostNextDay) @Html.LabelFor(m => m.PostNextDay) @Html.ValidationMessageFor(m => m.PostNextDay) </div> </div>
You can write verification in the Controller to control, the first parameter key and the second parameter prompt the content
ModelState.AddModelError( " PostNextDay " , $ "Write prompt content here " );