Display Custom Input Error Messages in an MVC View in ASP.Net
It is easy to display input errors using a field's validation message in a view. Simply call ModelState.AddModelError() passing in the property ID and error message, then return the View(). [...]