开发者

Attribute based validation in ASP.NET Web Forms using MVC libraries?

Is there a way in ASP.NET Webforms to accommodate开发者_StackOverflow中文版 attribute based validation. If so any urls where this has been demonstrated. I am not looking for open source projects. Just as you can use MVC Routing in Web Forms, can the validation framework be used?


Routing is common for whole asp.net, therefore - you can easily use it in webforms too.


'Attribute based validation' is based on so called DataAnnotations. They aren't even asp.net specific, but common for whole .net. Mvc framework just uses them etc.

You might find this tutorial useful. I'm not sure i would use such an approach - but it's certainly possible.


Check this out. A really good Validation Framework for ASP.Net Webforms.

http://imar.spaanjaars.com/QuickDocId.aspx?quickdoc=477

Attribute based validation in ASP.NET Web Forms using MVC libraries?


(source: spaanjaars.com)


Also check out the Microsoft Enterprise Library Validation Application Block. Compared to DataAnnotations, it has a much larger feature set, visual studio integration, more possibilities to be extended and future versions will be able to read DataAnnotations attributes, but it also has a much steeper learning curve. Because of its complexity it isn't always a good fit for small projects.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜