There's already an answered question about the same subject but as it's from '09 I consider it outdated.
How to properly implement "Confirm Password" in ASP.NET MVC 3?
I'm seeing a lot of options on the Web, most of them using the CompareAttribute
in the model like this one
The problem is that definitely ConfirmPassword
shound't be in the model as it shouldn't be persisted.
As the whole unobstrusive client validation from MVC 3 rely on the model and I don't feel like putting a ConfirmPassword property on my model, what should I do?
Should I inject a custom client validation function? If so.. How?