In the last recipe you saw that we can pass error messages to be displayed to the validation attribute. However, by default, the attributes accept only a message in the English language. To display a localized custom message, it needs to be fetched from an external source such as an XML file or database. In this recipe, we will see how to use an XML file to act as a backend for localized messages.
The following steps will help you generate a localized validation message using XML:
CustomValidation.slnin Visual Studio .NET 2012.
CookBook.Recipes.Core.CustomValidationproject. Name it
Messages.xml. In the Properties window, set Build Action to Embedded ...