-
Notifications
You must be signed in to change notification settings - Fork 40
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
Attribute not recognized (MVC4): System.ComponentModel.DataAnnotations.EmailAddressAttribute : DataTypeAttribute #33
Comments
The problem is that in the EmailAddressAttribute the error message is assigned in the contructor, so it's like the error message is specified as a data annotation.. and it is not created in the database because of this: Here the code by microsoft: namespace System.ComponentModel.DataAnnotations |
I'm also facing the same issue |
I love the inconsistnency. If they just could stick to one solution to make it easier to localize the attributes. |
I'm giving up. I can fix it without using more ASP.NET MVC hacks. I've started to work on an alternative validation library for MVC which will be an drop in replacement. |
hats off... |
Hello,
the issue is related to the localization library.
If i decorate a property with the EmailAddressAttribute (so it is validated as an email) it seems that the library recognize it as its base type (DataTypeAttribute).
The validation message is not displayed as untranslated, too, in the pages (the notation with the []).
The EmailAddressAttribute class belongs to the Assembly System.ComponentModel.DataAnnotations.dll, v4.0.0.0
Another issue i had is that i can't understand how the translations are automatically inserted in the database.. i found the ID field that i've never displayed (@Html.Display(m=>m.ID) so i expect the library doesn't add it.. I expect that just the text shown somewhere in my application should be translated.
The text was updated successfully, but these errors were encountered: