0

I am trying to implement jquery autocomplete textbox in asp.net. But I am getting the error "Object doesn't support this property or method" though while coding I am getting 'autocomplete' function in intellisense. I have tried to use google api link as well in case my jquery files are not getting loaded correctly, but i am getting the same error. Following is my code:

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">  

   <script src="Scripts/jquery-1.11.2.js" type="text/javascript"></script>
    <script src="Scripts/jquery-ui.js" type="text/javascript"></script>        
    <link href="Styles/jquery-ui.css" rel="stylesheet" type="text/css" />
    <script language="JavaScript" type="text/JavaScript">
        $(document).ready(function () {

            $("[id*=txtPCTrx]").autocomplete({                    
                    source: function (request, response) {
                        $.ajax({
                            url: "PCAdd.aspx/GetAutoCompleteData",
                            type: "POST",
                            dataType: "json",
                            contentType: "application/json; charset=utf-8",
                            data: "{'txt':'" + $('[id*=txtPCTrx]').val() + "'}", //json to represent argument
                            dataFilter: function (data) { return data; },
                            success: function (data) {
                                response($.map(data.d, function (item) {
                                    return {
                                        label: item,
                                        value: item
                                    }
                                }))
                                //debugger;
                            },
                            error: function (result) {
                                alert("Error");
                            }
                        });
                    },
                    minLength: 1,
                    delay: 1000
                });
</script>

Apart from the above autocomplete function I have many other jquery functions which are working properly in the same page. Please help.

Sormita Chakraborty
  • 1,015
  • 2
  • 19
  • 36
  • use only one of these script files not both and script . Both scripts are same but one is minified script file. refer this link http://stackoverflow.com/questions/3475024/whats-the-difference-between-jquery-js-and-jquery-min-js – Frebin Francis Feb 25 '15 at 09:08
  • remove the extra jquery-ui.js and try the simpler code, dont make it complex, you do not have to send json in order to make this request, just send as string – valar morghulis Feb 25 '15 at 09:12
  • 1
    Why do you access jquery-ui.js AND jquery-ui.min.js? – Roy Dictus Feb 25 '15 at 09:13
  • Though I have removed jquery-ui.min.js I am getting the same error. – Sormita Chakraborty Feb 25 '15 at 10:24

0 Answers0