title: Client-side validation for custom StringLength validation attribute
body: <p>I have the following custom validation attribute, which derives from StringLengthAttribute:</p>
  
  <pre><code>public class StringLengthLocalizedAttribute : StringLengthAttribute
  {
      public StringLengthLocalizedAttribute(int maximumLength) : base(maximumLength)
      {
          var translator = DependencyResolver.Current.GetService&lt;ITranslator();
          var translatedValue = translator.Translate("MaxLengthTranslationKey", ErrorMessage);
          ErrorMessage = translatedValue.Replace("{MaxLength}", maximumLength.ToString());
      }
  }
  </code></pre>
  
  <p>The only purpose of this custom attribute is to localize the ErrorMessage. The problem is, when I use this in my models it does not generate any client-side validation, but the standard StringLength attribute does.</p>
  
  <p>I don't see how my attribute differs in any way - since it derives from the StringLength attribute I shouldn't have to implement any additional functionality to get client side validation working?</p>