I'm developping an ASP.NET MVC3 application.
I use DataAnnotations
for some properties of my Models, with a custom error message if input is not correct.
However, it perfectly works when I run my app in localhost, but when I put it on my webserver (which is a shared web server), the error message is the one by default.
Here is an example :
[Required]
[Range(1d, 1000d, ErrorMessage = "My custom error message in French")]
public decimal Surface { get; set; }
When user type "abcde" in Surface
field, I have the following error message :
The field Surface must be a number.
However, it should display the specified ErrorMessage. This works in localhost but not on my webserver.
I tried to force culture in web.config
as follow :
<globalization culture="fr-FR" uiCulture="fr-FR"/>
But this doesn't work.
How can I force the application to display the ErrorMessage
?
I can't modify anything on the web server which hosts my app, it's a personal project hosted on a local website hosting.
Thanks for your help