2012-07-05 37 views
0

我有一個表單,我允許登錄用戶更改他們的密碼。每當我在重新輸入密碼框中輸入密碼時,我會彈出一個要求我選擇要更改密碼的用戶!令人震驚的是,這種彈出式視頻甚至出現,因爲它看起來像是一個明顯的安全漏洞。用戶選擇彈出式菜單時重新輸入密碼框填寫

enter image description here

我的視圖代碼的相關部分是

<p> 
      <label for="ViewModelChangePassword_Password"> 
       Password</label> 
      <input type="password" value="" name="ViewModelChangePassword.Password" id="ViewModelChangePassword_Password" /> 
     </p> 
     <p> 
      <label for="ViewModelChangePassword_Password1"> 
       Re-enter password</label> 
      <input type="password" value="" name="ViewModelChangePassword.Password1" id="ViewModelChangePassword_Password1" /> 
     </p> 

這究竟是爲什麼?作爲一個獨立的問題,我希望發生的就是這個驗證運行

[Required] 
[DataType(DataType.Password)] 
[DisplayName("Password")] 
public string Password { get; set; } 

[Required] 
[DataType(DataType.Password)] 
[DisplayName("Re-enter Password")] 
[Compare("Password", ErrorMessage = "Passwords must match")] 
public string Password1 { get; set; } 

感謝,

薩欽

+0

我問問題沒人能回答。 – 2012-07-05 14:42:55

回答

1

這不會有任何與ASP.NET,MVC也沒有驗證。您可能正在使用Firefox測試您的頁面,並選擇了保存密碼的選項。

每當您更改該網站的密碼時,Firefox會要求您選擇要更改密碼的用戶名。

+0

+1非常有幫助的建議 – 2012-07-05 14:53:41