title: Password DataAnnotation in ASP.NET MVC 3
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/4116147/password-validation-regex">Password validation (regex?)</a>  </p>
  </blockquote>
  
  
  
  <p>I am working on asp.net MVC 3 application and I have applied </p>
  
  <pre><code>    [Required]
      [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
      [DataType(DataType.Password)]
      [Display(Name = "Password")]
      public string Password { get; set; }
  </code></pre>
  
  <p>DataAnnotation to my Password field. I want to make sure that password must be at least 6 characters, no more than 18 characters, and must include at least one upper case letter, one lower case letter, and one numeric digit. Do I need to add regular expression or DataType.password will do all this ?</p>
  
  <p>Please suggest</p>