August 2018
Intermediate to advanced
298 pages
5h 33m
English
For each of the fields, we have added a span tag where the error message is displayed in a red color when the validation fails. When the validation succeeds, there will be no error message displayed. The attribute value of asp-validation-for represents the field name for which the validation error message has to be displayed. For example, we have used the span tag with the asp-validation-for attribute and with the Name value, which tells ASP.NET MVC to display the validation error message for the Name field.
Views/Employee/Index.cshtml looks as follows:
@model MVCEF.ViewModels.EmployeeAddViewModel@* //For more information on enabling ...
Read now
Unlock full access