title: Custom error messages get from method that access database for data annotation tags in MVC
body: <p>Hello I've got a model of USER 
  and for example the property FIRSTNAME IS REQUIRED AND MUST BE BETWEEN 2 and 50 characters. 
  That's why I use  data annotation and the field FirstName  in my class looks like :</p>
  
  <pre><code>public  class User
      {
         [Required(ErrorMessage = "{0}" + GETMESSAGEFROMDATABASE();)]
         [Range(typeof(int), "0", "100", ErrorMessage = "{0}" + GETMESSAGEFROMDATABASE();)]
  
          public string FirstName { get; set; }
          ...........................
     }
  </code></pre>
  
  <p>The problem is when I post the data and the Modelstate is not valid and I'm returned again in Register page I want to give custom error messages for each of the errors and the text should be get from a function; Please don't ask why I - just accept that I've got no other choice. </p>
  
  <p>SO I want my validation summary to look like this : </p>
  
  <p>*Name of the field : custom message for the error get from function</p>
  
  <p>*Name of the field : custom message get from function</p>