Razor Pages Password Input Box Keeps Displaying Default Dots

621 Views Asked by At

Built Add and Edit pages in .NET Core 3.1 Razor pages. When Edit page displays, both the "Password" and "Confirm Password" input boxes render empty as they should. When the Add pages displays, the "Confirm Password" input renders empty but the "Password" input renders with 15 default dots already entered. The input box code seems exactly the same on both pages:

<div class="form-group">
    <label asp-for="User.user_password"></label>
    <input type="password" class="form-control" asp-for="User.user_password" />
    <span asp-validation-for="User.user_password"></span>
</div>
<div class="form-group">
    <label asp-for="User.confirm_password"></label>
    <input type="password" class="form-control" asp-for="User.confirm_password" />
    <span asp-validation-for="User.confirm_password"></span>
</div>

Tried adding value="" but it still rendered the default dots. I'm not populating the inputs on the backend with anything. Any ideas?

Add Inputs Edit Inputs

2

There are 2 best solutions below

0
On BEST ANSWER

Update on my comment.

If problem is in browser autofill, you could try to clear autofill for that domain.

How to clear saved auto fill passwords in chrome

0
On

add autocomplete="off" to html

 <input type="password" class="form-control" asp-for="User.confirm_password" autocomplete="off" />