Reputation: 11129
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?
Upvotes: 3
Views: 2336
Reputation: 41
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!!
Upvotes: 0
Reputation: 44916
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.
Upvotes: 2
Reputation: 32343
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.
Upvotes: 3