Click here to Skip to main content
15,894,343 members

Master page does not load or refer jquery files even those jquery scripts runs on other pages and user control

vijendradudhe asked:

Open original thread
XML
I am trying to implement slider in my website ,The slider I have created in usercontrol. When I use that control with .aspx page it works fine but the same control I have implemented in master page it does not work. I have got some help on internet and using this  "ResolveUrl"
<script src='<%# ResolveUrl("~/Scripts/jquery-1.4.1.min.js")%>' type="text/javascript"></script>
and script reference
<asp:ScriptManager ID="ScriptManager1" runat="server">
      <Scripts>
        <asp:ScriptReference Path="/Scripts/jquery-1.4.1.min.js" />
</Scripts>



I have tried but still masterpage does not refer jquery .
I have got this code from this link "http://www.c-sharpcorner.com/UploadFile/rohatash/jquery-image-slider-in-Asp-Net/"

My Code:
 <script src='<%# ResolveUrl("~/Scripts/jquery-1.4.1.min.js")%>' type="text/javascript"></script>
    <link href="Styles/nivo-slider.css" rel="stylesheet" type="text/css" />
    <link href="Styles/Default.css" rel="stylesheet" type="text/css" />
    <link href="Styles/nivo-slider.css" rel="stylesheet" type="text/css" />
    <script src='<%# ResolveUrl("/Scripts/Demo.js")%>' type="text/javascript"></script>

 <div class="slider-wrapper theme-default">
        <div id="nivo-slider" class="nivoSlider">
           <asp:Image ID="Image0" ImageUrl="~/Images/1.jpg" runat="server" />
            <asp:Image ID="Image3" ImageUrl="~/Images/2.jpg" runat="server" />
            <asp:Image ID="Image2" ImageUrl="~/Images/3.jpg" runat="server" />
            <asp:Image ID="Image1" ImageUrl="~/Images/4.jpg" runat="server" />
        </div>
    </div>
    <script type="text/javascript">
        $(window).load(function () {
           // $('#nivo-slider').nivoSlider();
            $('[id$=nivo-slider]').nivoSlider();
        });
    </script>

 please somebody help me to come out of this problem.

Thanks in advance
Tags: ASP.NET

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900