I've seen numerous posts and tips on CP and elsewhere that show people having successfully implemented the AjaxControlToolkit auto-complete without a webservice but I just can't get the page method to fire.
I think I've tried every approach out there, but to no avail. My code, at present, looks like this:
.aspx:
<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" EnablePageMethods="true" </asp:ToolkitScriptManager>
<asp:TextBox runat="server" ID="tbMatterReference" />
<asp:AutoCompleteExtender ID="tbMatterReference_AutoCompleteExtender"
runat="server" DelimiterCharacters="" Enabled="True"
ServiceMethod="GetCompletionList" CompletionInterval="0" CompletionSetCount="1" ServicePath=""
TargetControlID="tbMatterReference" UseContextKey="True"></asp:AutoCompleteExtender>
aspx.cs:
[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public static string[] GetCompletionList(string prefixText, int count)
{
MatterDetailsList matters = new MatterDetailsList();
List<string> list = new List<string>();
foreach (MatterDetails matter in matters.MatterDetails)
{
list.Add(matter.code);
}
return list.ToArray<string>();
}
There are no errors as such, it just doesn't do anything. Breakpoints in the code behind aren't hit and the TextBox just works as a vanilla TextBox.
I'm sure that I'm missing something blindingly obvious!