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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s