Turn off AutoComplete when using Atlas AutoCompleteExtender
Background
The title of this post might seem a bit confusing, so first let's define a few things:
The Atlas AutoCompleteExtender is a server control that adds an auto-complete behavior to a text box. The results are displayed in a drop-down panel underneath the text box. Rather than just show a history of what was entered into the text box, the auto-complete results are returned from a web service call that you implement. The image below shows the results of what can potentially be a long list of items from my wife:
The browser AutoComplete is just a history of items that have been entered into a text box. As you start to enter text into the text box it will display the results from previous entries.
The Problem
If you use the AutoCompleteExtender and the browser settings for AutoComplete are enabled, you will get an overlay of both when entering text into the text box. In the image below you can see both the history and the auto-complete results from the web service displayed below the text box.
Solution
All we need to do is set the autocomplete attribute of the text box to 'off' :
<asp:TextBox ID="textBox1" runat="server" autocomplete="off" />
You can also turn off autocomplete for the entire form:
<form id="form1" method="post" runat="server" autocomplete="off">
You can do this programmatically as well:
textBox1.Attributes.Add("autocomplete", "off");