Вопрос

How can I localize/change DataAnnotations Required field validator and other resource parameters?

RequiredAttribute_ValidationError has value "The {0} field is required" in System.ComponentModel.DataAnnotations.Resources?

Это было полезно?

Решение

Use these properties to override the default error message for the Required attribute ErrorMessageResourceName
ErrorMessageResourceType

[Required(ErrorMessageResourceName="MyLocalizedResourceName", ErrorMessageResourceType="MyLocalizedResourceType")]
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top