On our model, if we add the attribute to a property like so:
[OurValidationAttribute(new [] { typeof(AllowedType1) }, ErrorMessage = "The property '{0}' can only have types of '{1}')]
public virtual LinkItemCollection Links {get;set;}
The validation error message returned is 'The property 'Links' can only have types of 'AllowedType1'.
However, if we want to use a localized string, i.e.:
"i.e. the Localization has not occured." Sorry, what I should have said, is the Localization has taken place, but the formatting of the args has not....
Hi all,
We have a custom validation attribute. Within the attribute we have overridden the FormatErrorMEssage method, like so:
On our model, if we add the attribute to a property like so:
The validation error message returned is 'The property 'Links' can only have types of 'AllowedType1'.
However, if we want to use a localized string, i.e.:
The message returned is "The property '{0}' can only have types of '{1}'"
i.e. the Localization has not occured.
Has anyone else seen this? Any thoughts on how to get round this?
Thanks in advance
Al