ASP.Net MVC + Autocomplete Search not working
<p>I'm a beginner &amp; I'm trying to develop a autocomplete search box with ASP.Net MVC 5. I use Northwind Database and Entity Framework 6.</p>

<p>Here is my index.cshtml code </p>

<pre><code>@model IEnumerable&lt;AutoComplete3.Models.Customers&gt;

&lt;link href="~/Content/jquery-ui.css" rel="stylesheet" /&gt;
&lt;script type="text/javascript" src="~/Scripts/jquery-1.9.1.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="~/Scripts/jquery-ui.js"&gt;&lt;/script&gt;

&lt;script type="text/javascript"&gt;
    $(function () {
        $("#txtSearch").autocomplete({
            source: '@Url.Action("GetCustomers")'
        });
    });
&lt;/script&gt;

@using (@Html.BeginForm())
{
    &lt;b&gt;Name : &lt;/b&gt;
    @Html.TextBox("searchTerm", null, new { @id = "txtSearch" })
    &lt;input type="submit" value="Search" /&gt;
}
</code></pre>

<p>Here is my CustomerController class</p>

<pre><code>public class CustomersController : Controller
{
    northwindEntities db = new northwindEntities();

    public ActionResult Index()
    {
       return View(db.Customers);
    }

    [HttpPost]
    public ActionResult Index(string SearchTerm)
    {
        List&lt;Customers&gt; customers;
        if (string.IsNullOrEmpty(SearchTerm))
        {
            customers = db.Customers.ToList();
        }
        else
        {
            customers = db.Customers.Where(c =&gt; c.CompanyName.StartsWith(SearchTerm)).ToList();
        }
        return View(customers);
    }       

    public JsonResult GetCustomers(string term)
    {
        List&lt;string&gt; customers;
        customers = db.Customers.Where(c =&gt; c.CompanyName.StartsWith(term)).Select(y =&gt; y.CompanyName).ToList();
        return Json(customers,JsonRequestBehavior.AllowGet);
    }
}
</code></pre>

<p>This code is working when i am searching records, by entering keyword &amp; clicking submit button. But the GetCustomer method cannot be called by the jquery script. Inspect Elements shows following error.</p>

<pre><code>Uncaught TypeError: $(...).autocomplete is not a function
</code></pre>

<p>The text box should be suggest Company Names to the textbox itself. How to correct this.</p>

<p>Thanks.</p>