I use jquery for client side validation along with data annotations. Everything works fine, but I would like to localize the message when a numeric value is entered into a numeric text field. For server-side validation, this can be done by setting DefaultModelBinder.ResourceClassKey to the name of the resource class and providing a value for the PropertyValueInvalid key.
However, for checking on the client side, asp.net mvc uses its own resource file with the key 'ClientDataTypeModelValidatorProvider_FieldMustBeNumeric'. The only way to solve this problem is described in the Client-side validator and client-side validator in MVC 2 using jQuery.validate . The solution really works, but I was wondering if there is an easier or more correct way to do this.
Thank.
source
share