3

I'm using the .net ajaxtoolkit control AutoCompleteExtender. It works great but my firefox autocomplete overrides the values that the extender is returning (the firefox one lays on top of the control's).

is there a way to disable the browser's version of autocomplete so that the .net one takes precendence?

Kyle
  • 10,839
  • 17
  • 53
  • 63

3 Answers3

3

Try this:

<asp:TextBox ID="txtFirstName" runat="server" autocomplete="off" />

The trick is setting autocomplete="off".

Actually it is defined in HTML 5 standards, but should work in most modern browsers.

Oleks
  • 31,955
  • 11
  • 77
  • 132
2

If you are using an ASP.Net TextBox, you can simply add the following attribute to the control:

AutoCompleteType="Disabled"

Looks something like this:

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

EDIT:

The property above only works for IE based browsers. However, if you add this attribute to the control:

autocomplete="off"

It should work in FireFox and Chrome.

Josh
  • 44,706
  • 7
  • 102
  • 124
  • Tried that...it's still doing it in Firefox. I checked the source code and there's nothing on the that would indicate it shouldn't try to autocomplete.... – Kyle May 10 '10 at 16:14
0

Had the same problem in FireFox.

I have set the attribute in the page OnPreRender. (in my case a usercontrol)

protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);

        txtAutoComplete.Attributes.Add("autocomplete", "off");
    }    

Now it works like in IE.

Great!!

Rony
  • 31
  • 2