title: Default resource for data annotations in ASP.NET MVC
body: <p>There's a way to set the default resource to the data annotations validations?</p>
  
  <p>I don't wanna make something like this:</p>
  
  <pre><code>[Required(ErrorMessage="Name required.", ErrorMessageResourceType=typeof(CustomDataAnnotationsResources)]
  public string Name { get; set; }
  </code></pre>
  
  <p>I would like something like this:</p>
  
  <p><strong>Global.asax</strong></p>
  
  <pre><code>DataAnnotations.DefaultResources = typeof(CustomDataAnnotationsResources);
  </code></pre>
  
  <p>then</p>
  
  <pre><code>[Required]
  public string Name { get; set; }
  </code></pre>
  
  <p>someone gimme a light!</p>
  
  <p>thanks in advance</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>My real problem was with EF Code First CTP4. CTP5 fix it. Thanks for everyone.</p>