Home Uncaught TypeError: $(...).autocomplete is not a function in ASP.MVC application
Reply: 0

Uncaught TypeError: $(...).autocomplete is not a function in ASP.MVC application

user2958 Published in March 19, 2018, 1:17 am

I have simple ASP.NET MVC Index page where I want to include autocomplete search textbox. I have included reference also. But still its showing the same error. My page looks like:

@model IEnumerable<TestProject.Models.Test>

    <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.9.2/jquery-ui.min.js" type="text/javascript"></script>
    <link href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.9.2/themes/blitzer/jquery-ui.css" rel="Stylesheet" type="text/css" />
    <script type="text/javascript">
        $(function () {
                source: function (request, response) {
                        url: '/Home/AutoComplete/',
                        data: "{ 'prefix': '" + request.term + "'}",
                        dataType: "json",
                        type: "POST",
                        contentType: "application/json; charset=utf-8",
                        success: function (data) {
                            response($.map(data, function (item) {
                                return {
                                    value: item.FName,
                                    id: item.Id
                        error: function (response) {
                        failure: function (response) {
                select: function (event, ui) {
                minLength: 1


@using (Html.BeginForm("Index", "Home", FormMethod.Post))

    <form class="form-inline">
        <div class="form-group">
            <label for="Search">Search</label>
            <input type="text" class="form-control" id="txtCustomer" name="CustomerName" placeholder="Search">
            <input type="hidden" id="hfCustomer" name="CustomerId" class="form-control">
        <input type="submit" id="btnSubmit" value="Search" class="btn btn-info" />


If i put this code then i works fine but it removes default style provided by ASP.NET MVC.


Layout = null;

I have googled it but could not found appropriate solution. Please help me to resolve this issues. Thank you in advance.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.301521 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO