asp.netasp.net-mvcvalidationmodelbinders

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


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?


Solution

  • 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.