I’ve followed this tutorial…
My Controller’s method “Name” is never call…
Here is the code:
View
<script src="@Url.Content("~/Scripts/jquery.autocomplete.js")" type="text/javascript"> </script>
<link href="@Url.Content("~/Scripts/jquery.autocomplete.css")" rel="stylesheet" type="text/css" />
<script type="text/javascript">
$(document).ready(function () {
$("#Name").autocomplete('@Url.Action("Name", "Reservation")', { minChars: 3 });//Never call... When I put a simple alert, it works !
});
</script>
<div class="editor-label">
@Html.LabelFor(model => model.Customer.Name)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.Customer.Name)
</div>
Controller method
public ActionResult Name(string q)
{
var customers = (from c in db.Customers where c.Name.Contains(q) select c.Name).Distinct().Take(10);
string content = string.Join<string>("\n", customers);
return Content(content);
}
I’m lost… Can you help me to find what I’m doing wrong please ? Thanks in advance…
Finally he reaches my controller’s method ! But He never display the list corresponding to the input text 🙁
Update 16:04

The ID for the input generated by:
Won’t just be
Name, it will beCustomer_Name:There seems to be some confusion here, the tutorial you’re following uses jQuery Autocomplete but you appear to be using jQuery UI autocomplete. Both are slightly different, using the default options:
jQuery-UI Autocomplete
(http://jqueryui.com/demos/autocomplete/):
jQuery Autocomplete
(https://github.com/dyve/jquery-autocomplete)