Disable browser autocomplete for ajax: AutoCompleteExtender

I am using .net ajaxtoolkit control AutoCompleteExtender. It works fine, but my autocomplete firefox overrides the values ​​returned by the expander (firefox alone lies on top of the control).

Is there a way to disable the autocomplete version of the browser so that .NET can accept the preliminary assessment?

+3
source share
3 answers

Try the following:

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

The trick is setting autocomplete="off".

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

+3
source

ASP.Net, :

AutoCompleteType="Disabled"

:

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

EDIT:

, IE. , :

autocomplete="off"

FireFox Chrome.

+2

There was the same problem in FireFox.

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

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

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

Now it works like in IE.

Great!!

0
source

Source: https://habr.com/ru/post/1744804/


All Articles