• Disable AutoComplete on Textbox in ASP.NET

    by Venkata Koppaka | Sep 25, 2011
    There are cases when you want to turn off AutoComplete that all modern browsers offer for textbox.
    This article will guide you through on how to disable AutoComplete in ASP.NET.

    There are two ways you can achieve this -
    1. Using AutoCompleteType (works in IE and .NET specific). You can read more about AutoCompleteType here
    2. Using AutoComplete (works in all browsers, HTML attribute).
    AutoCompleteType
    AutoCompleteType can be used for achieve different behavior on the textbox, using AutoCompleteType="Disabled" turns off AutoComplete when using IE.

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


    AutoComplete
    AutoComplete is a HTML attribute that can be used for any language / platform and it works in all the browsers. AutoComplete="Off" on the textbox (input) turns off AutoComplete on all browsers.

    <asp:TextBox ID="tbAutoCompleteAll" runat="server" autocomplete="Off"></asp:TextBox>

    You can download code for this post here.

    Hope this helps.

    Cheers
    Venkata
    Go comment!