views:

42

answers:

3

Is there a way in ASP.NET Webforms to accommodate 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?

+3  A: 

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.

Arnis L.
+1  A: 

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

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

alt text

this. __curious_geek
A: 

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.

Steven