0

In MVC3 you could write something like this:

[Required(ErrorMessage="Please fill some field that I need")]
public string someFieldThatINeed;

But what about custom validation attributes? Will they transforms to client-side javascript code and validate as well as embedded validation attributes do? Or do I need to write my own javascript client code? Thanks!

kseen
  • 359
  • 8
  • 56
  • 104

1 Answers1

1

If custom attributes do not derive from some of the standard validation attributes or require some special validation logic you could implement the IClientValidatable and write custom client adapters. Here's an example.

Community
  • 1
  • 1
Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928