The AutoCompleteExtender works only after there is a postback. The first time the page loads, and user types in the textbox, it doesnt work. But after there is a postback like checkedChnaged, buttonClick etc, & user types now, the suggestion list shows up. Its like the extender is activated only after postbacks.
ASPX:
<asp:TextBox ID="txtSearch" runat="server" OnTextChanged="txtSearch_TextChanged"
onchange="itemSelected();"></asp:TextBox>
<asp:AutoCompleteExtender ID="ace" runat="server" TargetControlId="txtSearch"
MinimumPrefixLength="2" EnableCaching="true" CompletionSetCount="10"
CompletionInterval="0" ServiceMethod="GetCodes" UseContextKey="True"
CompletionListCssClass="autoComplete"
CompletionListItemCssClass="autoCompleteItem"
CompletionListHighlightedItemCssClass="autoCompleteHL"
>
</asp:AutoCompleteExtender>
CS:
[System.Web.Script.Services.ScriptMethod()]
[System.Web.Services.WebMethod]
public static string[] GetCodes(string prefixText)
{
CountryBLL objCountry = new CountryBLL();
return objDAL.GetCodes(prefixText);
}