I followed a very simple example of autocompletion using ajax and cannot get mine to work. I stepped threw the code and it looks like it never goes to my webmethod. What else is there to check?
.aspx
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:TextBox ID="txtFrom" runat="server">
</asp:TextBox>
<ajaxToolkit:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" TargetControlID="txtFrom" MinimumPrefixLength="1" ServiceMethod="GetSuggestions">
</ajaxToolkit:AutoCompleteExtender>
.aspx.cs
[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public static string[] GetSuggestions(string prefixText, int count, string contextKey)
{
string[] members = { "Nick", "John", "Bob" };
return (from m in members where m.StartsWith(prefixText, StringComparison.CurrentCultureIgnoreCase) select m).Take(count).ToArray();
}
I created a webservice to use instead of putting my method directly in the class, but I get the same result.