Data-annotation getting errormessage out database
问题 With asp.net mvc you can use the annotation [Required (errormessage="This is required")] How can I create something like this: [Required (errormessage="ERRORXX")] So I can look up in a database what this ERRORXX is and display it on my form. Now my form displays ERRORXX. How can I create something that solves my problem? Thx! 回答1: Just an idea: why not pull the error messages from a resx file? I think this is the common way of doing this. It even allows you to localize your error messages