How to validate two properties with ASP.NET MVC 2
- by CodeMonkey
Hey folks :-)
I'm just getting started with ASP.NET MVC 2, and playing around with Validation.
Let's say I have 2 properties:
Password1
Password2
And I want to require that they are both filled in, and require that both are the same before the model is valid.
I have a simple class called "NewUser".
How would I implement that? I've read about ValidationAttribute, and understand that. But I don't see how I would use that to implement a validation that compares two or more properties against eathother.
Thanks in advance!