public class SomeValidator : ValidationAttribute
{
public SomeValidator()
: base("Message")
{
}
protected override ValidationResult IsValid(object value, ValidationContext validationContext)
{
return new ValidationResult("ERROR");
}
And :
[SomeValidator]
public long Something { get; set; }
Why isValid method is never invoked ? (I use ASP MVC 3) Thanks for help!
You must ensure that you have a controller action taking this model as action argument:
and then:
or that you call the
UpdateModel/TryUpdateModelmethod: