Computer Magic Logo

Wednesday, March 16, 2016

Published by Aristotelis Pitaridis

Data Annotation allows us to validate the model properties within an ASP.NET MVC application. The ASP.NET MVC Data Annotations work in Umbraco with one small problem. If we want to display different error messages depending on the selected language then we will have to store the messages in resource files. This is how it can be done in ASP.NET MVC. Umbraco has a different tool for handling localized strings which is the Dictionary.

CM Umbraco Tools has a set of data annotations which allows the developer to use the dictionary name in order to inform the system what message from the dictionary should be displayed.