I wan to use an AjaxToolkit AutoCompleteExtender. My WebService is triggered and, if I put a breakpoint on the returned value, I can see there is data being returned. But, AutoCompleteExtender is not displaying the results.
I've read this stackoverflow thread: AutoCompleteExtender is firing, webservice is returning results, but these are not being displayed
But, that answer does not solve the issue I'm having.
Here's my code:
ASPX
<asp:ToolkitScriptManager ID="asm" runat="server" EnablePageMethods="true" EnablePartialRendering="true"></asp:ToolkitScriptManager>
<asp:UpdatePanel ID="upApprovedBy" runat="server">
<ContentTemplate>
<asp:TextBox id="txtApprovedBy" runat="server" AutoComplete="Off"></asp:TextBox>
<asp:AutoCompleteExtender
runat="server"
ID="ac_txtApprovedBy"
CompletionInterval="500"
TargetControlID="txtApprovedBy"
ServiceMethod="SearchWinUsers"
CompletionSetCount="20"
MinimumPrefixLength="2"
>
</asp:AutoCompleteExtender>
</ContentTemplate>
</asp:UpdatePanel>
ASPX.CS
[System.Web.Script.Services.ScriptMethod()]
[System.Web.Services.WebMethod]
public static string[] SearchWinUsers(string prefixText, int count)
{
logic common = new logic();
string[] SelectedApprovers = new string[0];
try
{
DataTable dt = new DataTable();
string sql = "SELECT TOP(" + count + ") FirstName + ' ' + LastName AS DisplayName FROM USERSTABLENAME WHERE (IsDeActivated = 0) AND ((FirstName LIKE '%" + prefixText + "%') OR (LastName LIKE '%" + prefixText + "%')) ORDER BY FirstName";
dt = common.getDataTable(sql);
SelectedApprovers = new string[dt.Rows.Count];
int i = 0;
foreach (DataRow dr in dt.Rows)
{
SelectedApprovers.SetValue(dr["DisplayName"].ToString(), i);
i++;
}
dt.Dispose();
}
catch (Exception ex)
{
common.alert("Error in page.location.<br>ERROR=" + ex.Message);
}
return SelectedApprovers;
}
Any suggestions would be appreciated!
I should mention that the code in my ASPX snippet lives in this hierarchy: Page > TabContainer > TabPanel > FormView > THIS CODE LIVES HERE