-1
我有自动完成文本的JQuery.I使用ChromeBug的问题,一切都很好。文本发送到控制器,我把断点看看他得到什么东西看起来很好。 但在文本框中,我没有任何建议。JQuery自动完成和MVC没有建议
我CONTROLER看起来像这样:
public JsonResult AutocompleteTowns(string term) {
return this.Json(db.Miastoes.Where(x => x.Nazwa.StartsWith(term)).ToString(), JsonRequestBehavior.AllowGet);
}
SCRIPT:
$(document).ready(function() {
$('#nazwaMiasta').autocomplete({
source: '@Url.Action("AutocompleteTowns", "Administrator")'
});
)};
你有什么想法有什么不对?