I have been banging my head against the desk over this one.
I have added a AutoCompleteExtender to my webpage, and have implemented the webservice method for it to call. So far, so good.
Using Fiddler, I have checked that, when debugging, the webservice method is being called and is returning the results I'd expect to see.. but nothing gets rendered to the screen, there is no drop down?
Can anyone here suggest what I might have done wrong, or offer a suggestion for something to try as I am currently stumped:
Declaration of the AutoCompleteExtender in the webpage:
<cc1:AutoCompleteExtender runat="server" ID="lookupAgencyAppSettingName"
TargetControlID="txtAgencyAppSettingName" ServiceMethod="GetListOfSettings"
ServicePath="~/Authenticated/AJAXMethods.asmx" MinimumPrefixLength="1"
CompletionInterval="500" EnableCaching="true" />
For completeness, here is the Webservice Method:
[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public string[] GetListOfSettings(string prefixText, int count)
{
string[] suggestedSettings = new string[0];
List<string> settingNames = new List<string>();
List<AgencyApplicationClientSetting> settings = AgencyApplicationClientSetting.All().ToList<AgencyApplicationClientSetting>();
foreach(AgencyApplicationClientSetting setting in settings)
{
if((setting.SettingName.ToLower().StartsWith(prefixText.ToLower())) && (!settingNames.Contains(setting.SettingName)))
{
settingNames.Add(setting.SettingName);
}
}
if(settingNames.Count > 0)
{
suggestedSettings = settingNames.ToArray();
}
return suggestedSettings;
}