Solved

Why won't jquery-ui library load into my asp.net web page?

Posted on 2014-07-27
1
913 Views
Last Modified: 2014-07-27
Hi:

I have an ASP.net application.
The application uses the standard ASP.net template out of the box (with master page & content).

The application uses the AjaxControlToolkit TabContainer control.
I also make use of the jquery.js and jquery-ui libraries.

I'm running into some weird issues with the combination of the AjaxControlToolkit, jquery and jquery-ui.
It all seems to be related to where the libraries get included in the aspx pages.

1) If I load the jquery and jquery-ui libraries in the default page's <asp:Content>, then the jquery-ui library
    does not load. I look in developer tools (Chrome) and there are no errors. I look at the scripts that get loaded,
    and jquery-ui does not get loaded.

Consider the following:
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <script type="text/javascript" src="/Scripts/jquery-2.1.1.min.js" />
    <script type="text/javascript" src="/Scripts/jquery-ui.min.js" />

Open in new window

2) To try to fix this, I tried moving around where I actually load the libraries. If I load the jquery library on the master page and load the jquery-ui on my default page, then it seems that jquery-ui gets loaded. However
the jquery library seems to somehow clash with the TabContainer
<--- This is from Site.Master.aspx -->
<head id="Head1" runat="server">
    <title></title>
    <link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
     <script type="text/javascript" src="/Scripts/jquery-2.1.1.min.js" />
    <asp:ContentPlaceHolder ID="HeadContent" runat="server">
    </asp:ContentPlaceHolder>
</head>

<--- This is from default.aspx -->
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <script type="text/javascript" src="/Scripts/jquery-ui.min.js" />

Open in new window

When I do the above, the
TabContainer functions correctly, but I lose all my styles

So my question is "How/Where do I include jquery and jquery-ui so they get loaded correctly
with my web page with colliding with the AjaxControlToolkit  TabContainer?

Thanks,
JohnB
0
Comment
Question by:jxbma
1 Comment
 
LVL 1

Accepted Solution

by:
jxbma earned 0 total points
Comment Utility
Really?
Really?
    <script type="text/javascript" src="/Scripts/jquery-2.1.1.min.js" ></script>
    <script type="text/javascript" src="/Scripts/jquery-ui.min.js" ></script>

Open in new window

instead of this:
 <script type="text/javascript" src="/Scripts/jquery-2.1.1.min.js" />
    <script type="text/javascript" src="/Scripts/jquery-ui.min.js" />

Open in new window

Fixed the issue?
Really?
That took 3 hours to figure out.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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.
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
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)

771 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

12 Experts available now in Live!

Get 1:1 Help Now