title: Using parameter for StringLength attribute
body: <p>The code which is generally generated for a ASP.NET MVC 3 Membership, escpecially the property <code>NewPassword</code> of the class <code>ChangePasswordModel</code> looks roughly like:
  </p>
  
  <pre><code>    [Required]
      [StringLength(100, MinimumLength=6)]
      [DataType(DataType.Password)]
      [Display("Name = CurrentPassword")]
      public string NewPassword { get; set; }
  </code></pre>
  
  <p>In order to to fill some information with external parameters I am using <code>RecourceType:</code><br>
  <em>(In this case I am changing <code>OldPassword</code> and fill the attribute <code>Display</code> with some additional Data from a Resource</em></p>
  
  <pre><code>    [Required]
      [DataType(DataType.Password)]
      [Display(ResourceType = typeof(Account), Name = "ChangePasswordCurrent")]
      public string OldPassword { get; set; }
  </code></pre>
  
  <p>Back to <code>NewPassword</code>. <strong>How can I substitute the <code>MinimumLenght</code> with <code>Membership.MinRequiredPasswordLength</code>?</strong> : My attempt:</p>
  
  <pre><code>    [Required]
      [StringLength(100, MinimumLength=Membership.MinRequiredPasswordLength)] 
      [DataType(DataType.Password)]
      [Display(ResourceType=typeof(Account), Name= "ChangePasswordNew")]
      public string NewPassword { get; set; }
  </code></pre>
  
  <p>This produces the error:</p>
  
  <blockquote>
    <p>An attribute argument must be a constant expression, typeof expression
    or array creation expression of an attribute parameter type
    (<a href="http://msdn.microsoft.com/de-de/library/09ze6t76%28v=vs.90%29.aspx" rel="noreferrer">http://msdn.microsoft.com/de-de/library/09ze6t76%28v=vs.90%29.aspx</a>)</p>
  </blockquote>