简体   繁体   中英

User selection popup when re-enter password box filled in

I have a form in which I allow logged in users to change their passwords. Whenever I type a password into the re-enter password box I get a popup asking me to choose a user for which to change the password for! It is shocking that this sort of pop-up even comes up as it looks like a glaring security hole.

在此处输入图片说明

The relevant part of my view code is

 <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>

Why is this happening? As a separate issue what I want to happen is for this validation to run

[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; }

Thanks,

Sachin

This doesn't have anything to do with ASP.NET, MVC nor validation. You are probably testing your page with Firefox and have selected an option to save passwords.

Whenever you change your password for that site, Firefox will ask you to select for which username you are changing the password.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM