TypeError: $(…).autocomplete is not a function
<p>I am getting the above error using the following code inside a ASP.NET MVC</p>

<pre><code>&lt;script type="text/javascript" &gt;
$(document).ready(function () {
    $("#Name").autocomplete({
        source: function (request, response) {
            $.ajax({
                url: "/Home/Index",
                type: "POST",
                dataType: "json",
                data: { Prefix: request.term },
                success: function (data) {
                    response($.map(data, function (item) {
                        return { label: item.Name, value: item.Name };
                    })
                }
            })
        },
        messages: {
            noResults: "", results: ""
        }
    });
})
</code></pre>

<p></p>

<p>Jquery is definitely loaded, and I have tried using a different variable for $ - any ideas what else might be the problem?</p>