This function is not working please help me i need to auto complete the data in suggested text box
$('#BrandName').autocomplete({ source: function (request, response) { $.getJSON("/DataCollection/SuggestBrandName?term=" + request.term, function (data) { response(data); }); }, minLength: 1, delay: 100 });
my json result
public JsonResult SuggestProduct(string term) { var DataBase = new DataBaseEntities(); var allProduct = DataBase.Tbltables.Select(s => s.BrandName).ToList(); var getAutocomplete = allProduct.Where(item => item.ToUpper().StartsWith(term.ToUpper())).Distinct().ToList(); DataBase.Dispose(); return Json(getAutocomplete, JsonRequestBehavior.AllowGet); }