Closed Edddy closed 12 years ago
Was this fixed or it's a "Won't fix"?
@jgauffin: It's hard to be collaborative if you don't communicate with us
I'm on vacation. Will look at is as soon as I get back. I thought that I had fixed it. However it's hard to get everything working properly (1. be able to use custom validation attributes 2. use the built in attributes 3. use custom error messages in the attributes).
Microsoft hides the actual language handling inside the dataannotation attributes and then caches them in MVC3.
I understand it's hard and I can try to help you in anything you need, but we need that you coordinate the efforts. Anything from "Too hard, won't fix", "Please try to fix it yourself", or "Fixed" is good for me.
Hope you enjoy your vacations!
Should work now
Excellent!
How to we instanciate the providers now? This old sample code does not work now
var stringProvider = new ResourceStringProvider(Resources.LocalizedStrings.ResourceManager);
ModelMetadataProviders.Current = new LocalizedModelMetadataProvider(stringProvider);
ModelValidatorProviders.Providers.Clear();
ModelValidatorProviders.Providers.Add(new LocalizedModelValidatorProvider(stringProvider));
humm. That should work. What kind of error do you get? (although I never tried with a string table only)
(you can email me at jonas.gauffin@gmail.com for faster responses regarding this issue)
If you try to override the default error message the validation is skipped and always validate i.e: