Im trying to develop my first ASP.NET MVC web app and have run into a problem with the jquery ui autocomplete widget.
At the moment I have a form with a number of text boxs which would lend themselves well to an autocomplete ability.
The code for my "Make"(Car make) text box is show below:
jquery:
$(function() {
$("#Make").autocomplete({
source: '<%=Url.Action("Make","AutoComplete") %>'
});
});
ASP.NET MVC controller:
public ActionResult Make(string term)
{
return Json(Service.GetHints(HintType.Make, term, 20));
}
GetHints()
returns an IList of Hints, an object with just label and value string properties. The documentation implies that this is what I should be returning to the jquery but it doesnt want to work? Can anyone give me any advice/help?