开发者

CompareAttribute validator?

Validation attributes are realy nice. But what if I have to compare one proper开发者_运维问答ty 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?


Check out this SO answer.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜