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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:15:56+00:00 2026-06-11T06:15:56+00:00

In my asp.net mvc3 application, I added autoComplete for my search box. When I

  • 0

In my asp.net mvc3 application, I added autoComplete for my search box. When I test it, there are 3 results returned back from the action. You can see a list showed up, however, this is an empty list, you only see 3 < li >< /li >, and there’s nothing there between the li tag.

I pretty sure, action is fine, because, It did return 3 results back. I can verify that by seeing 3 empty < li > tag. what should I do to add name < li > apple < / li>

        $("#searchbox").autocomplete({
            source:"/Home/SearchIngredients",
            minLength: 2

        });


    public virtual JsonResult SearchIngredients(string term)
    {
        var ingredients = _smoothieService.GetIngredients(term);

        var data = ingredients.Select(x => new {Id = x.NDB_No, Value = x.Name}).Take(25).ToArray();
        return Json(data, JsonRequestBehavior.AllowGet);
    }
  • 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-06-11T06:15:57+00:00Added an answer on June 11, 2026 at 6:15 am

    Something like this:

    $('#search').autocomplete({
        source: function (request, response) {
            $.ajax({
                url: "/Home/SearchIngredients",
                dataType: 'json',
                data: request,
                success: function (data) {
                    response(data.map(function (value) {
                        return {
                            'label': '<li>' + value.Id + '</li>',
                            'value': value.Value
                        };  
                    }));
                }   
            }); 
        },  
        minLength: 2
    })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The moment I added a unit test to my ASP.NET MVC application to test
I have the following WebGrid in my ASP.NET MVC3 test application. It displays a
In an ASP.NET MVC3 application I have an Action method that returns a file
While working on ASP.NET MVC3 application, by mistake I have added a Class library
I have an ASP.NET MVC3 application that I have built and it has two
In my asp.net mvc3 application, I have a custom Authorization Attribute as seen below.
I have a ASP.NET MVC3 application that handles time-consuming processes (copying a large file
In an ASP.NET MVC3 application, I'm trying to use jQuery to make an asynchronous
I am creating an ASP.NET MVC3 application using NHIBERNATE. I have a base class
I am working on an ASP.NET MVC3 application. In the Views I created 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.