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);
}