DDataBLL _data = new DDataBLL(); public ActionResult Ara() { return View(); } public ActionResult AraJSON(string term) { var data = _data.SelectAll().Where(x => x.Icerik.Contains(term)); return Json(data, JsonRequestBehavior.AllowGet); }
@{ ViewBag.Title = "Ara"; Layout = "~/Views/Shared/_Layout.cshtml"; }@model IEnumerable<JQueryAutoComplete.Models.DData> <h2> jQuery Ui Autocomplete</h2> <script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.min.js")" type="text/javascript"></script> <link href="@Url.Content("~/Content/themes/base/jquery.ui.all.css")" rel="stylesheet" type="text/css" /> <script type="text/javascript"> $(function () { $("#deger").autocomplete({ source: "/DData/AraJSON", minLength: 1, }); }); </script> <div class="demo"> <div class="ui-widget"> <label for="deger"> Bir değer girin: </label> <input id="deger" size="50" /> </div> </div>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)