문제

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