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

  • Home
  • SEARCH
  • 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 3607686
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:24:25+00:00 2026-05-18T21:24:25+00:00

I am having a strange issue. I am trying to use jQuery autocomplete with

  • 0

I am having a strange issue. I am trying to use jQuery autocomplete with asmx web service. My JavaScript code is as:

$('#txtUsers').autocomplete('AjaxHandler.asmx/GetUserData', {
    width: 320,
    max: 5,
    minChars: 3,
    parse: function(data) {
        var items = data.d;
        var parsed = [];
        for (var i = 0; i < items.length; i++)
            parsed.push({
            data: [items[i]],
            value: items[i],
            result: [items[i]]
        });
        return parsed;
    }
});

and my web service code is:

[WebService]
[ScriptService]
public class AjaxHandler : WebService
{
    [WebMethod]
    public List<UserData> GetUserData(string q)
    {
        //My code here.....
    }
}

However my web method is not being called from autocomplete. However whenever I try to call the same web method from jQuery.ajax, it gets fired correctly. Any help?

  • 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-18T21:24:25+00:00Added an answer on May 18, 2026 at 9:24 pm

    I checked that autocomplete send get request, but you service accept only post requests. So, i see that you also found it.

    I suggest to use simple HttpHandler, and return data as json using newton json serializer, because you web service retun ‘wrapped’ data.
    It should be very simple handler:

    List<UserData> items = GetUserDataItems();
    string json = JsonConvert.SerializeObject(items);
    

    //retrun json to the client

    Also at client code set dataType to json:

    dataType: "json",
    

    And parse like this:

    parse: function (data) {
        return $.map(data, function (row, i) {
            return {
                data: row,
                value: row,
                result: row
            }
        });
    },
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having a strange issue with some C# code - the Getter method for a
hello fellow java developers. I'm having a very strange issue. I'm trying to read
I am having a strange issue with trying to style a link as a
I'm having a really strange issue with .htaccess - I'm trying to rewrite the
I'm having a bit of a strange issue with Nokogiri in Rails. I'm trying
I am having a strange DB2 issue when I run DBUnit tests. My DBUnit
I'm having a strange problem. I have to use GetPostBackEventRefence to force a Postback,
This is a strange problem that I am having with WCF trying to send
I'm trying to get a simple Lift example running and I'm having a strange
Having a strange issue in IE7. In a number of spots, I have a

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.