• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 584
  • Last Modified:

AutoCompleteExtender doesn't work

Why does the following does not work?

<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:TextBox ID="txt" runat="server"></asp:TextBox>
<ajaxToolkit:AutoCompleteExtender ID="ace1" runat="server" TargetControlID="txt"
  ServicePath="test.asmx" ServiceMethod="GetCompletionList"

I have a test.asmx with the following code:

        public string[] GetCompletionList(string prefixText, int count)
            if (count == 0)
                count = 10;

            if (prefixText.Equals("xyz"))
                return new string[0];

            Random random = new Random();
            List<string> items = new List<string>(count);
            for (int i = 0; i < count; i++)
                char c1 = (char)random.Next(65, 90);
                char c2 = (char)random.Next(97, 122);
                char c3 = (char)random.Next(97, 122);

                items.Add(prefixText + c1 + c2 + c3);

            return items.ToArray();

When debugging, the debugger never stops at the WebMethod.

What could be the reason for that?

1 Solution
Tapan PattanaikSenior EngineerCommented:
hi Relegence,

                    There is a tutorial , which will guide you to proceed further.

Use the ASP.NET AJAX AutoComplete Control:


AutoComplete Demonstration:


Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now