Wednesday, September 21, 2016

The Compare attribute on a getsetter, making sure the double entry for a password is sound in MVCland, may reference a resource for its error message.

[Compare("Password", ErrorMessageResourceType = typeof(Resources.Resources),
      ErrorMessageResourceName = "Whatever")]

For more on the Compare attribute see this. It is possible to just only give [Compare("Password")] for the attribute in which case an error message will just be made up for you. It's very plain Jane and has a "cannot compare 'X' to 'Y'" flavoring.

No comments:

Post a Comment