1

Validation attributes are realy nice. But what if I have to compare one property to another. How can I implement that?

Scott has a great example for Email attribute validator at http://weblogs.asp.net/scottgu/archive/2010/01/15/asp-net-mvc-2-model-validation.aspx but it's bind to only one property.

What if I need to compare one date to another (DateFrom, DateTo), so that DateFrom is before DateTo?

dmonlord
  • 1,370
  • 9
  • 16

1 Answers1

1

Check out this SO answer.

Community
  • 1
  • 1
Matthew Abbott
  • 60,571
  • 9
  • 104
  • 129
  • It sure is an ugly solution, but it's a valid answer, so you get your points :) I think I'm gonna do the validation "the old way" – dmonlord Jul 23 '10 at 20:04