Introduction:
AutoComplete is an ASP.NET AJAX extender that can be attached to any TextBox control, and will associate that control with a popup DropDown like list of words that begin with the prefix typed into the textbox.
Create a new website using ASP.NET Ajax-Enabled Web Site:

Now drag and drop three controls on page. ScriptManager, Textbox, AutoCompleteExtender.
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<cc1:AutoCompleteExtender ID="AutoCompleteExtender1"
runat="server"
ServicePath="WebService.asmx"
ServiceMethod="FindName"
MinimumPrefixLength="1"
TargetControlID="TextBox1">
</cc1:AutoCompleteExtender>
</div>
</form>
Now add a new WebService class:

Here is web service code.
Imports System
Imports System.Collections.Generic
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Data.SqlClient
Imports System.Data
Imports System.Data.Common
Imports AtlasTextBoxAutoComplete.DL
Imports System.Collections
<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<System.Web.Script.Services.ScriptService()> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class WebService
Inherits System.Web.Services.WebService
<WebMethod()> _
<System.Web.Script.Services.ScriptMethod()> _
Public Function FindName(ByVal prefixText As String, ByVal count As Integer) As String()
'return all records whose Title starts with the prefix input string
Dim titleArList As New List(Of String)()
Dim drProducts As SqlDataReader = sqlProductProvider.GetNameList(prefixText)
While drProducts.Read()
Dim strTemp As String = Convert.ToString(drProducts("Name"))
titleArList.Add(strTemp)
End While
Return titleArList.ToArray()
End Function
End Class
Result will look like this:

I am adding two classes in App_Code folder for database connectivity. You shoudl change your web.config key for database connection string. I am attaching my database in App_Code folder.
Amit RaiPosted Feb 4, 2011, 12:05 AM
this is a very nice article C#.net3.5 autocomplete within gridview but wait... i have a table (named- ItemInformation and fields id(PK),ItemCode , Name , Color,Price,Quantity). Now on .aspx page within the gridview(which is empty on form load) i have some textboxes for ItemID,ITemCode,color, Name,Price,Quantity etc.with a button to add a new row. Now i want to apply autocomplete on ITemCode textbox and after selecting from that autocomplete http://www.c-sharpcorner.com/AdRedirector.aspx?BannerId=532&target=http://www.discountasp.net/tfs/go/go.aspx?i=14951values, the other textbox fields such as(name,id ,color,price )are automatically filled regarding to that selected value. plz help me.
Rajai BhaveshPosted Jan 28, 2011, 2:33 AM
Hello...Sir this code garnet in vb.net
black black manPosted Nov 2, 2010, 11:41 AM
Thanks
Ahmad HussainPosted Sep 19, 2010, 8:39 AM
Hello, Your sample rocks! despite I need to retrieve selected users id(for ID entry purpose) i.e. I need to display name but I will insert id of select employee. Can you assisst me on this!!! secondly I need to display employee name and employee id respectively but once you select it will only display employee name..is there any way??? Thanks in advance plz reply on [email protected]
Pushpendra Kumar TripathiPosted Aug 16, 2010, 1:33 AM
when we enter any letter how come the data is retrieving
Shivam MAiniPosted May 25, 2010, 2:29 AM
I want to know that can we use Ajax without downloading any additional tool or compiler in .net 3.5. If so then How????? Plz do help me i really need it for submission of my project.
NissePosted Feb 3, 2010, 5:40 PM
The site is "c-sharpcorner" and your eample is in VB???
travisPosted Apr 27, 2009, 3:03 PM
where does it read from? a database
bhrugesh thakkarPosted Feb 7, 2009, 1:50 PM
gv me same code in c#