开发者

Which validation framework is better?

Does anyone have any recommendations for either of these validation ASP.Net MVC Validation frameworks?

  1. xVal: http://xval.codeplex.com/
  2. FluentValidation: http://fluentvalidation.codeplex.com/documentation
  3. NHibernate.Validator
  4. DataAnnotations
  5. 开发者_如何学编程

by the way: my project use sharp-architecture


This is a personal opinion, xVal and FluentValidation have there pro's and con's. NHibernate.Validator is lighter weight, and functions better if you are already using NHibernate as your schema loader. Then the obvious DataAnnotations is built into ASP.NET which is always something hard to resist.

Personally I use xVal for the built in jQuery validation.


If you're using MVC 2, DataAnnotations and an xVal-like client side validation is built in.

If you're using MVC 1, you can use xVal alongside DataAnnotations. In fact, xVal by itself won't do anything for you--it's just a technology to link a server-side validation framework like DataAnnotations to a client-side validation framework like jQuery validation.

We're using DataAnnotations + xVal on a project and it's worked out all right. We needed to make some changes to the DataAnnotationsModelBinder.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜