Example for implementing Autocomplete in ASP.NET Textbox


A great new aspect of the TextBox control is the AutoCompleteType attribute, which enables you to apply the auto-completion feature to your own forms.

AutoComplete in asp.net textbox

<%@ Page Language="C#" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<
head runat="server">

<
title>AutoComplete in Textbox</title>

</
head>
<
body>
<form id="form1" runat="server">

<
div>
<div style="height: 100px"></div>

<
b>Name:</b>
<asp:TextBox ID="TextBox1" runat="server" AutoCompleteType="DisplayName" Width="144px"></asp:TextBox>

</
div>

</
form>
</
body>
</
html>

To make autocomplete work in firefox , change the settings as given here.

Please note that autocomplete should be disabled for sensitive data.