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 4346976
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T12:14:42+00:00 2026-05-21T12:14:42+00:00

I followed a very simple example of autocompletion using ajax and cannot get mine

  • 0

I followed a very simple example of autocompletion using ajax and cannot get mine to work. I stepped threw the code and it looks like it never goes to my webmethod. What else is there to check?

.aspx

    <asp:ScriptManager ID="ScriptManager1" runat="server">

    </asp:ScriptManager>

<asp:TextBox ID="txtFrom" runat="server">
</asp:TextBox>
<ajaxToolkit:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" TargetControlID="txtFrom" MinimumPrefixLength="1" ServiceMethod="GetSuggestions">
</ajaxToolkit:AutoCompleteExtender>

.aspx.cs

[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public static string[] GetSuggestions(string prefixText, int count, string contextKey)
{
    string[] members = { "Nick", "John", "Bob" };

    return (from m in members where m.StartsWith(prefixText, StringComparison.CurrentCultureIgnoreCase) select m).Take(count).ToArray();
}

I created a webservice to use instead of putting my method directly in the class, but I get the same result.

  • 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-21T12:14:43+00:00Added an answer on May 21, 2026 at 12:14 pm
    public static string[] GetSuggestions(string prefixText, int count, string contxtKey)
    

    You wrote contxtKey instead of contextKey

    Remember, the signature (type, parameters name, return type) has to match exactly.

    If the context key is used, it should
    have the same signature with an
    additional parameter named contextKey
    of type string:

    [System.Web.Services.WebMethod]
    [System.Web.Script.Services.ScriptMethod]
    public string[] GetCompletionList(
        string prefixText, int count, string contextKey) { ... }
    

    Note that you can replace
    “GetCompletionList” with a name of
    your choice, but the return type and
    parameter name and type must exactly
    match, including case.

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

Sidebar

Related Questions

I'm trying to compile a simple example from thrust graph. At the moment I
A very basic question concerning dropBox integration into an iPhone app. I followed the
Sorting is giving me a hard time. I need help with an small example,
Update: As François mentioned, there are alternatives such as Phone Gap for a more
During early development of my game I did not really regard how the game
I couldn't find a real andwer for what i need. I have a king
There are a few threads here at so about this matter but most of
I am afraid I similar question might be already asked somewhere, but I wasn't
I am currently ussing Tomahawk MyFaces to upload files in to my server. I

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.