I\'ve added validation checks in my controller that modify the ModelState
if the validation fails.
For example:
Actually you can set any validation message while your form submission unsuccessful suppose you make a field in model
[Required]
[DataType(DataType.Password)]
[Display(Name = "Current password")]
public string OldPassword { get; set; }
and while your modelState got invalid you can set error message bind with that field like as.
ModelState.AddModelError("OldPassword", "Current Password do not match ");
then your error message will be bind with field in model named "OldPassword"