title: custom validation attribute not working on client, just on server
body: <p>I am trying to implement custom attribute validation, similar to one demonstrated here in ScottGu's blog:
  <a href="http://weblogs.asp.net/scottgu/archive/2010/01/15/asp-net-mvc-2-model-validation.aspx" rel="nofollow">http://weblogs.asp.net/scottgu/archive/2010/01/15/asp-net-mvc-2-model-validation.aspx</a></p>
  
  <p>I have this custom validator attribute for Email:</p>
  
  <pre><code>public class EmailAttribute : RegularExpressionAttribute
        {
        public EmailAttribute() :
                  base("^[A-Za-z0-9](([_\\.\\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\\.\\-]?[a-zA-Z0-9]+)*)\\.([A-Za-z]{2,})$") { }
        }
  </code></pre>
  
  <p>My class uses it like this:</p>
  
  <pre><code>    [Required(ErrorMessage = ValidationCiM.MsgObaveznoPolje)]
      [Email(ErrorMessage = ValidationCiM.MsgMailNeispravan)]
      [StringLength(ValidationCiM.LenSrednjePolje, ErrorMessage = ValidationCiM.MsgSrednjePolje)]
      public string Mail { get; set; }
  </code></pre>
  
  <p>and it all works well on server side, model is validated ok, and everything. But client side validation does not activate for this the second attribute, it works for Required, and it also works for StringLength but not for Email.
  i have tried including both jquery and Microsoft ajax scripts, but there seems to be no difference.</p>
  
  <p>In ScottGu's blog, he states that the custom validation if implemented like this should work without the need to add custom script.</p>
  
  <p>Any ideas please?</p>