Solved

asp.net jquery issue

Posted on 2014-09-29
3
368 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
Comment Utility
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
Comment Utility
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
 

Author Comment

by:ITsolutionWizard
Comment Utility
I will try. Thank
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28372511.html) on how to make a page show some balloons animate up a page…
In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
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)
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

772 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now