<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
@using (Html.BeginForm()) {
@Html.TextBox("Search") <button type="submit" value="Search" id="btnSearch" name="Command">Search</button>
<script type="text/javascript">
$(document).ready(function () { $("#Search").autocomplete({ source: "/Search/Create", minLength: 1, select: function (event, ui) { if (ui.item) { $("#Search").val(ui.item.value); $("form").submit(); } } }); }); </script>
public ActionResult Create(string Search) {
var res = from m in db.Countries where m.Countrys.Contains(Search) select m; return Json(res, JsonRequestBehavior.AllowGet); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)