您好我正在嘗試創建一個註冊頁面。我正在使用linq to sql來創建數據模型。並創建了一個用於訪問數據的aditional類,我不知道這是否是實現它的核心方法但這是如何設法使其工作。比較字段
這裏是我的代碼:
[Required]
[DataType(DataType.Password)]
[Display(Name="Password")]
public string password
{
get { return member.Password; }
set { member.Password = value; }
}
[Required]
[DataType(DataType.Password)]
[Display(Name = "Confirm Password")]
[Compare("Password" , ErrorMessage = "The password and confirm pasword do not match")]
public string confirmPassword { get;set; }
我的數據庫不具有確認password.I正用於成員身份API生成的數據庫中的字段。
當我嘗試提交數據我得到這個錯誤:
Could not find a property named Password.
我如何corect呢?