Jonn
Jonn

Reputation: 4661

Using DataAnnotations validation in ASP.NET Webforms

Is there a way to use the same DataAnnotations validation commonly used in MVC in Webforms? Preferably including both Client-side and server-side functionality.

Upvotes: 5

Views: 5027

Answers (3)

Sundara Prabu
Sundara Prabu

Reputation: 2719

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

Upvotes: 0

Alexander Manekovskiy
Alexander Manekovskiy

Reputation: 3203

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.

Upvotes: 1

Pughjl
Pughjl

Reputation: 156

Haven't tried it myself, but this tutorial would indicate yes

Upvotes: 3

Related Questions