I try to change the message default from @Html.ValidationMessageFor
. Where is the file who i can chage the message: The _nameFied field is required.
View:
@Html.ValidationMessageFor(model => model.NumDoc,"", new { @class = "error-input"})
You can do it in your modal class's specific property using the ErrorMessage property in the of Required
attribute.
Ex:
public class MyClass{
[Required(ErrorMessage = "My validation error message goes here")] //give your validation message here
[Display(Name = "My display name")] //Give your display name here
public int NumDoc{ get; set; }
}
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