I'm trying to do validation using DataAnnotations almost done but validation messages not displaying can you please help.
In view have written all code validation firing but error message not displaying. this is the following code
==========================
@using (Html.BeginForm("Index", "Home", FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
{
@*@Html.AntiForgeryToken()*@
@Html.ValidationSummary(false)
@Html.Label("Employee Name", new { @class = "col-md-2 control-label" })
@Html.TextBoxFor(m => m.objemployeeinfo.EmployeeName, new { @class = "form-control", Name = "EmployeeName" })
@Html.ValidationMessageFor(m => m.objemployeeinfo.EmployeeName)
@Html.Label("Email ID", new { @class = "col-md-2 control-label" })
@Html.TextBoxFor(m => m.objemployeeinfo.EmailID, new { @class = "form-control",Name= "EmailID" })
@Html.ValidationMessageFor(m => m.objemployeeinfo.EmailID)
@Html.Label("Contact Number", new { @class = "col-md-2 control-label" })
@Html.TextBoxFor(m => m.objemployeeinfo.ContactNumber, new { @class = "form-control", Name = "ContactNumber" })
@Html.ValidationMessageFor(m => m.objemployeeinfo.ContactNumber)
}
===============Model Class=========================
public class EmployeeInfo
{
public int EmployeeID { get; set; }
[Display(Name = "Employee name")]
[Required (ErrorMessage ="Employee name required.")]
public string EmployeeName { get; set; }
[Required(ErrorMessage = "Email id required.")]
public string EmailID { get; set; }
[Required(ErrorMessage = "Contact Number required.")]
public string ContactNumber { get; set; }
public string Department { get; set; }
public string EmployeeType { get; set; }
public string Roles { get; set; }
}

SandyRank #2,015 · 718 reputationPosted Oct 9, 2017, 2:53 AM EDT
Anil kumar12 reputationPosted Oct 9, 2017, 4:24 AM EDT
SandyRank #2,015 · 718 reputationPosted Oct 9, 2017, 4:53 AM EDT
Anil kumar12 reputationPosted Oct 9, 2017, 8:21 PM EDT
Anil kumar12 reputationPosted Oct 9, 2017, 9:00 PM EDT
Vighnesh Gadekar56 reputationPosted Oct 31, 2017, 4:27 AM EDT