Autocomplete is not available in my asp:textBox

1.6k views Asked by At

I have this textBox:

    <asp:TextBox ID="txtInsuredPassword" TabIndex="1" runat="server" Width="157px"
          TextMode="Password" AutoCompleteType="Disabled" >
    </asp:TextBox>

AutocompleteType ="Disabled" is not working on chrome and I found that I have to use autocomplete="Off", but I cannot find it in my control ... any suggestions?

As you can see here autocomplete is not available

3

There are 3 answers

3
Krsna Kishore On

In the New page inside your Mark Up before your txtInsuredPassword try to keep this input type so that your problem will be solved

  <input style="display: none" type="password" name="fakepassword" />

At the time of DOM loading , broswer would first check for the inputtype password and autofill it with the Passowrd so we are just trying to avoiding it by keeping a fakepassword as input type

2
Aristos On
autocomplete="Off", but I cannot find it in my control ... any suggestions

Just place it on your asp.net text control and will appear on the html rendered page.

So your code will be as:

   <asp:TextBox ID="txtInsuredPassword" TabIndex="1" runat="server" Width="157px"
          TextMode="Password" AutoCompleteType="Disabled" autocomplete="Off" >
    </asp:TextBox>
2
Aminur Rashid On

Did you try this answer? If you're using firefox then you have to use: autocomplete="off" or from code behind:

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