Solved

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

Posted on 2014-07-27
1
929 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Hi all! Recently there was EE question and the person wanted to have a multi-column textbox <div> selection, so as a first step to answer I provided a link but that was not complete with JavaScript selection, but had a good style sheet. So as a ques…
What is a Lightbox? A Lightbox is the effect you see when you click, for example, an image and the screen fades out and up pops the same image but in its full size dimensions. There are lots of Lightbox effects for jQuery. Problem is they are a…
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)

786 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