How can I change that messages for all int fields so that instead of saying:
The field must be a number in English, it shows:
El campo tiene que ser numerico in Spanish.
Is there are a way?
We started with Q&A. Technical documentation is next, and we need your help.
Whether you're a beginner or an experienced developer, you can contribute.
|
How can I change that messages for all
Is there are a way? |
|||||||||||||
|
|
If you happen to be using ASP.NET MVC 4 onwards, check this post: Localizing Default Error Messages in ASP.NET MVC and WebForms Basically you have to add the following piece of code in your
Right click your ASP.NET MVC project in Solution Explorer inside Visual Studio and select Now add a Finally add the following string resources in that
You should be good to go. Note that the value you're interested in is the
If you happen to be using ASP.NET MVC 3 downwards, this solution can help you achieve the same result: http://stackoverflow.com/a/2551481/114029 |
|||||||||||||||||||||
|
|
you can set your custom message for your validation.
|
|||||||||
|
|
If you want to specify custom message for each Integer , double and float . you can use Range Attribute with String as below.
Now as above you can specify custom message for each and every propery . |
|||
|
|