Using DataAnnotations validation in ASP.NET Webforms
Is there a way to use the same DataAnnotations validation commonl开发者_如何学Pythony used in MVC in Webforms? Preferably including both Client-side and server-side functionality.
Haven't tried it myself, but this tutorial would indicate yes
here is my implementation of a validator you are asking for. It is fully functional data annotations validator, with both client- and server-side validation. And it supports the same extensibility schema as in MVC.
here is the answer it works if you have the proper namespaces in the webforms app, see my answer here Data Annotations in webforms at Model level
精彩评论