Solved

asp.net jquery issue

Posted on 2014-09-29
3
387 Views
Last Modified: 2014-10-24
Below codes are auto complete. and look like it has some impacts between 2 jquery.
Below codes are not working. However, if I put

<script src="assets/js/jquery-1.10.2.min.js" type="text/javascript"></script>

on top of the css. It is working.

How can I fix? My current website using 1.10.2
Thanks



<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm3.aspx.cs" Inherits="eCommercePrinterAcc.WebForm3" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
     

     <link rel="Stylesheet" href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.10/themes/redmond/jquery-ui.css" />
    <script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.8.0.js"></script>
    <script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.22/jquery-ui.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#searchpart").autocomplete({
                source: function (request, response) {
                    var param = { keywords: $('#searchpart').val() };
                    $.ajax({
                        url: "http://localhost:42335/WebService.asmx/GetProductsList",
                        data: JSON.stringify(param),
                        dataType: "json",
                        type: "POST",
                        contentType: "application/json; charset=utf-8",
                        dataFilter: function (data) { return data; },
                        success: function (data) {
                            response($.map(data.d, function (item) {
                                return {
                                    value: item
                                }
                            }))
                        },
                        error: function (XMLHttpRequest, textStatus, errorThrown) {
                            alert(textStatus);
                        }
                    });
                },
                minLength: 2//minLength as 2, it means when ever user enter 2 character in TextBox the AutoComplete method will fire and get its source data.
            });
        });
</script>

     <script src="assets/js/jquery-1.10.2.min.js" type="text/javascript"></script>
 
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <asp:TextBox runat="server" ID="searchpart" ></asp:TextBox>
    </div>
    </form>
</body>
</html>
0
Comment
Question by:ITsolutionWizard
3 Comments
 
LVL 82

Expert Comment

by:leakim971
ID: 40351425
which mean you have two different version of jQuery plugin running
if you still want to use two versions, use jQuery.noConflict().
Example here : http://api.jquery.com/jquery.noconflict/#example-4
0
 
LVL 12

Accepted Solution

by:
Ramkisan Jagtap earned 500 total points
ID: 40351605
You can also use: 1.10.2 version of jquery:

   <link rel="Stylesheet" href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.10.2/themes/redmond/jquery-ui.css" />
    <script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.10.2.js"></script>
    <script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.10.2/jquery-ui.js"></script>
0
 
LVL 1

Author Comment

by:ITsolutionWizard
ID: 40352378
I will try. Thank
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question