Today I faced the same problem:
To increase validity for a text field or any other field, you just need these two lines:
In the controller: ModelState.AddModelError("ErrorEmail", "Error Message");
In view: @Html.ValidationMessage("ErrorEmail")
And in web.config
<appSettings> <add key="ClientValidationEnabled" value="true" /> <add key="UnobtrusiveJavaScriptEnabled" value="true" /> </appSettings>
It was a rewrite of css with my own css website, so it did not show a red border around the text box.
make a validation error important my problem is resolved:
input.input-validation-error { border: 1px solid #e80c4d !important; }
Umar
source share