开发者

Using DataAnnotations validation in ASP.NET Webforms

开发者 https://www.devze.com 2023-02-05 18:48 出处:网络
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 mys

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

0

精彩评论

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

关注公众号