通常、ASP.NET MVC 3 メンバーシップ用に生成されるコード、特にNewPassword
クラスのプロパティは、ChangePasswordModel
おおよそ次のようになります。
[Required]
[StringLength(100, MinimumLength=6)]
[DataType(DataType.Password)]
[Display("Name = CurrentPassword")]
public string NewPassword { get; set; }
私が使用している外部パラメータでいくつかの情報を埋めるためにRecourceType:
(この場合、私はリソースからのいくつかの追加データでOldPassword
属性を変更して埋めていますDisplay
[Required]
[DataType(DataType.Password)]
[Display(ResourceType = typeof(Account), Name = "ChangePasswordCurrent")]
public string OldPassword { get; set; }
に戻るNewPassword
。を に置き換えるにはどうすればよいですか? MinimumLenght
Membership.MinRequiredPasswordLength
: 私の試み:
[Required]
[StringLength(100, MinimumLength=Membership.MinRequiredPasswordLength)]
[DataType(DataType.Password)]
[Display(ResourceType=typeof(Account), Name= "ChangePasswordNew")]
public string NewPassword { get; set; }
これにより、次のエラーが発生します。
属性引数は、属性パラメーター型の定数式、typeof 式、または配列作成式である必要があります ( http://msdn.microsoft.com/de-de/library/09ze6t76%28v=vs.90%29.aspx )