Solved

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

Posted on 2014-07-27
1
925 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
ID: 40222769
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn how to dynamically set the form action using jQuery.
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…

911 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

19 Experts available now in Live!

Get 1:1 Help Now