Cant get Jquery ui autocomplete widget to work
Posted
by Boob
on Stack Overflow
See other posts from Stack Overflow
or by Boob
Published on 2010-03-10T09:50:59Z
Indexed on
2010/03/26
1:03 UTC
Read the original article
Hit count: 519
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?
© Stack Overflow or respective owner