Hi friends i have used autocompletextender in my C# asp.net form . but it's not working fine. i have used following code.

 <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

   <asp:ScriptManager ID="script" runat="server" EnablePageMethods="true">
  </asp:ScriptManager>

   <asp:TextBox ID="txtServiceCityLocal" runat="server" Style="width: 292px; margin-left: 150px;
                                                    border: solid 1px #747474">
                                    </asp:TextBox>

   <asp:AutoCompleteExtender ID="AutoCompleteExtender2" runat="server"
               TargetControlID="txtServiceCityLocal" ServiceMethod="GetCountries"
                ServicePath="~/WebService.asmx" MinimumPrefixLength="2"
                CompletionInterval="100" EnableCaching="false" CompletionSetCount="10">
  </asp:AutoCompleteExtender> 

 [WebMethod]
    public List<string> GetCountries(string prefixText,int count)
    {      
        List<string> CountryNames = new List<string>();
        return CountryNames;
    }

After implementation of this code i put debugger on GetCountries method. it's not calling this methode.

Recommended Answers

All 2 Replies

are you sure this info is correct? correct path?

ServiceMethod="GetCountries" ServicePath="~/WebService.asmx"

where did the data coming from..? i mean what are the data that will autocomplete?is it in the dbase?array?or what?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.