-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")'
});
)};
你有什麼想法有什麼不對?