Ajax Asynchronous Postbacks
In the above example, the AJAX AutoComplete extender calls a webservice in the background to retrieve possible suggested plaque names which contain the
text that you type, as you type it. The minimum number of characters required is two, so nothing will happen when you type the first character.
Using a simple XML file and Linq select statement
[WebMethod]
public string[] GetCompletionList(string prefixText, int count)
{
XDocument doc = XDocument.Load(Server.MapPath("~/AutoComplete/BluePlaques.xml"));
var result = from e in doc.Descendants("marker")
where e.Attribute("label").ToString().ToLower().Contains(prefixText.ToLower())
select (string)e.Attribute("label");
return result.ToArray();
}