New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Client validation for custom validation attributes doesn't work #25
Comments
I've found a way to let it work. The follow example code will be called by Application_Start() in Global.asax.cs private void SetupLocalizationProviders() |
Hi, I tried your fix but actually the localization is not working anymore. Just the default texts are selected, not the ones from the database. Is there a real fix how to get the SQL Server Provider working with Client Validation? |
The code is available here: https://github.com/jgauffin/griffin.mvccontrib/blob/master/source/Griffin.MvcContrib/Localization/LocalizedModelValidatorProvider.cs Feel free to try to provide a fix. |
Hi jgauffin, |
step 1: modify the class LocalizedModelValidatorProvider, add a property as following code:
step 2: add helper class in your MVC project to extend the client validation rules, the following example code is for DataAnnotationsExtensions and MVC Foolproof Validation:
Step 3: in Global.asax.cs file:
|
thank you. :) I'll merge that code asap |
Hi, When can I get the new version? Thank you! |
I'm having a problem using localization,
using LocalizedModelValidatorProvider breaks client validation of custom validation attributes.
The way to register the client validation for the custom attribute is by registering an adapter in DataAnnotationsModelValidatorProvider, but as we cleared all ModelValidatorProviders to add LocalizedModelValidatorProvider then client validation is not working anymore.
I'm trying to use Data Annotations Extensions from: http://dataannotationsextensions.org/ and for example client validation for Email attribute does not work (But server validation do work)
And this is the way they register the adapters: DataAnnotationsModelValidatorProvider.RegisterAdapter
Is there any solution for this problem?
Thanks
The text was updated successfully, but these errors were encountered: