문제

I am using Enterprise Library 4.1 Validation Application Block. I have created a custom validator and overridden the DefaultMessageTemplate property. My DoValidate method logic is as below

LogValidationResult(validationResults, String.Format(DefaultMessageTemplate, currentTarget, key), currentTarget, key)

However, when I specify a custom MessageTemplate for this validator in the Configuration tool, only the DefaultMessageTemplate text is displayed. How do I override the default message with a custom message for custom validators?

I would appreciate any help.

Thanks!

도움이 되었습니까?

해결책

I managed to resolve this issue - it was because of incorrect constructors on the custom validator.

Thanks!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top