I am new to .net MVC. I am trying to validate a field from the model, but error message is not showing. Although the fields are red, the message just not show. Please see bellow :
The model:
[Required(AllowEmptyStrings = false, ErrorMessage = "FirstName is required")]
[Display(Name = "First Name")]
public string FirstName { get; set; }
The cshtml:
<div class="editor-field">
@Html.EditorFor(model => model.FirstName)
@Html.ValidationMessageFor(model => model.FirstName)
</div>
What am I missing?