i am doing MVC model validation through data annotation and my validation message is showing just at right side of input but i want to show it at the below of input box like the screen shot.
so just tell me what i need to do without touching html. thanks
Click on "Add". The Html. ValidationMessage() is an extension method, that is a loosely typed method. It displays a validation message if an error exists for the specified field in the ModelStateDictionary object.
In order for the Validator 's error message to display in the ValidationSummary , you need to set the Validator s Display="none" . I also set Text="" . C.C. C.C.
You can provide a custom error message either in the data annotation attribute or in the ValidationMessageFor() method.
You can alter field-validation-error
and validation-summary-errors
classes in CSS to make them reside on a new line. One way is to make them block elements by using display:block
style. Here is a sample CSS:
.field-validation-error {
display: block;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With