简体   繁体   中英

Validation Application block - custom validator - message template

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM