I have a model property like below,
[Index("CourseCodeIndex", IsUnique = true)]
[MaxLength(15)]
public string Name { get; set; }
and if I use invalid data it works well but returns no error message. Is there any way to show a message on (view, like other required like messages)
@Html.ValidationMessageFor(model => model.Name)
Make an instance of your context file
add the code below to your controller action method
And the
@Html.ValidationSummary(true)
from your view will attach the error message