简体   繁体   中英

Browser Remember password set username to other textboxes also

When I use browser remembered password, after login, some textboxes in my forms shows username. I am confused, how it works? Please provide solution to avoid this problem?

Set TextBox property TextMode as Password

or try this

TextBox1.Attributes.Add("autocomplete", "off");

<form id="Form1" method="post" runat="server" autocomplete="off"></form>

Using Javascript you can also delete history of textbox

function disableautocompletion(id){ 
    var passwordControl = document.getElementById(id);
    passwordControl.setAttribute("autocomplete", "off");
}

Try:

 <asp:TextBox ID="MyTextBox" AutoCompleteType="Disabled" runat="server" />

this renders as:

 <input id="MyTextBox" name="MyTextBox" type="text" autocomplete="off" />

for more info MSDN for autocomplete

And this is helpful link

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