Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6990403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:20:42+00:00 2026-05-27T19:20:42+00:00

I am using an AutoCompleteExtender from AjaxControlToolkit on a TextBox . To put it

  • 0

I am using an AutoCompleteExtender from AjaxControlToolkit on a TextBox.

To put it simply, when I drag and drop the AutoCompleteExtender tool on to my TextBox and then click on “Add AutoComplete page method”, I get the following error:

Cannot create page method “GetCompletionlist because no CodeBehind or
CodeFile was found!

After googling the error, I basically made my own web-service called AutoCompelte.asmx. Below is the code for that class:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;

namespace AutoCompleteTest
{
    /// <summary>
    /// Summary description for AutoComplete
    /// </summary>
    [WebService(Namespace = "http://microsoft.com/webservices/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    [System.Web.Script.Services.ScriptService]
    public class AutoComplete : System.Web.Services.WebService
    {
        [System.Web.Services.WebMethodAttribute(), System.Web.Script.Services.ScriptMethodAttribute()]
        public static string[] GetCompletionList(string prefixText, int count, string contextKey)
        {
            // Create array of movies  
            string[] movies = { "Star Wars", "Star Trek", "Superman", "Memento", "Shrek", "Shrek II" };

            // Return matching movies  
            return (from m in movies where m.StartsWith(prefixText, StringComparison.CurrentCultureIgnoreCase) select m).Take(count).ToArray();
        }  
    }
}

Of course, the above is dummy data…. Later on, I shall be getting the data from a database.

And my Default.aspx looks like this:

<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>
    From
<asp:TextBox ID="txtFrom" runat="server">
</asp:TextBox>  


<asp:AutoCompleteExtender runat="server" 
    ID="txtFrom_AutoCompleteExtender" 
    TargetControlID="txtFrom"
    ServiceMethod="GetCompletionList"
    ServicePath="AutoComplete.asmx"
    MinimumPrefixLength="2" 
    CompletionInterval="1000"
    EnableCaching="true"
    CompletionSetCount="20"
    DelimiterCharacters=";, :"
    ShowOnlyCurrentWordInCompletionListItem="true">
</asp:AutoCompleteExtender>

When I run the website….and type in the textbox, nothing happens. No Extender is shown. Even if I type “Star”.

What am I missing and why was I getting that error at the beginning?

P.S. I am on my University computers so, I think that error might be due to the type of network i am using. not sure.

Any help is HIGHLY HIGHLY HIGHLY appreciated!!

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T19:20:43+00:00Added an answer on May 27, 2026 at 7:20 pm

    I got it working. This is how I fixed it:

    My project was a “Website Application” in Visual Studio. When I simply made a “Website” project, it all worked perfectly…. I don’t know why, it just did.

    So if anyone else is having the same problem, try port the code over to a “Website” project rather than a “Website Application” project.

    Hope that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the AJAX autocomplete add-on to the <asp:textbox> control. I have everything
I'm using the AutoCompleteExtender from the AJAX control toolkit on my aspx page -
I'm using the MS AJAX AutoCompleteExtender on a textbox. It's working fine, except when
What's benefit using jQuery Autocomplete over Ajax AutoCompleteExtender? Can some one explains the benefits
I've got an asp.net page containing a Textbox with an Autocomplete extender on it.
I want to use AutoCompleteExtender with textbox to auto complete user's entry from mysql
Using AutoCompleExtender from the Ajax Control Toolkit, if MinimumPrefixLength=0 and CompletionInterval=100, and you click
I'm using an AutoCompleteExtender in ASP.NET/C# to retrieve data from my database, along with
I have an AjaxControlToolkit.AutoCompleteExtender control attached to a textbox, and three radio buttons. When
I am using AutoCompleteExtender in my application and somehow the the suggestion box started

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.