1

Is there anyway to override the custom validation error messages from the ValidationAttributes?

Basically I need the ValidationAttributes to support globalization.

Jon Seigel
  • 12,251
  • 8
  • 58
  • 92
Raphael
  • 7,972
  • 14
  • 62
  • 83

1 Answers1

2

I saw a question on ScottGu's blog about it and he responded with, that is if you are using DataAnnotations. Are you?

Yes - you can localize that today. In addition to specifying the string explictly you can alternatively provide a resource key. That allows you to fully localize the error messages.

UPDATE: I was looking at some other stuff and came across this article. Thought it might help you, or anyone else that may stumble across it.

http://blog.maartenballiauw.be/post/2009/11/05/Localize-ASPNET-MVC-2-DataAnnotations-validation-messages.aspx

Dustin Laine
  • 37,935
  • 10
  • 86
  • 125