AutoCompleteExtender Web Service

 If you've worked with the AutoCompleteExtender, you know that the extender returns a nice drop down list that only contains items with the keywords entered.  As you type more and more characters, the results in the list are filtered by the characters currently entered, until the item sought after is the only one left, or no items are left.

Personally, I had a really hard time getting this to work, and what I didn't realize is that the service requires a specific layout.  This layout should be in the form:

[WebMethod]
public string[] GetAutoCompleteResults(string prefixText, int count) { }

or, if using a context key:

[WebMethod]
public string[] GetAutoCompleteResults(string prefixText, int count, string contextKey) { }

Then the AutoCompleteExtender can hook up to the service and call this method, providing real-time filtered results.

Published Saturday, August 02, 2008 5:17 AM by bmains
Filed under:

Comments

No Comments