Asp.net Textbox Autocomplete without web service

<ajaxToolkit:AutoCompleteExtender ID=”xxx” runat=”server”
TargetControlID=”txtKeywords”
ServiceMethod=”GetProviders”
CompletionInterval=”200″
MinimumPrefixLength=”2″>

And in your xxxx.aspx.cs file, just add

[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public static string[] GetProviders(string prefixText, int count)
{

return Provider.GetProviderNames();

}

Advertisement