I’m in a situation where jquery works within an aspx page without masterpage, but with master pages it sucks. Here is what i’m doing… I’m using jquery image slider with in mysite in Home.aspx page.
Below is the Home.aspx with master page :
<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
CodeBehind="Home.aspx.cs" Inherits="WebApplication3.Home" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div id="main">
<h1>
Apple-like Slideshow Gallery</h1>
<div id="gallery" style="border: 1px solid red;">
<div id="slides">
<div class="slide">
<img src="Images/imac.jpg" />" width="920" height="400" alt="side" /></div>
<div class="slide">
<img src="Images/iphone.jpg" />
width="920" height="400" alt="side" /></div>
<div class="slide">
<img src="Images/macbook.jpg" />
width="920" height="400" alt="side" /></div>
</div>
</div>
</div>
</asp:Content>
here is Master.aspx coding :
<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="Site.master.cs" Inherits="WebApplication3.SiteMaster" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head runat="server">
<title></title>
<link href="Styles/demo.css" rel="stylesheet" type="text/css" />
<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
<asp:ContentPlaceHolder ID="HeadContent" runat="server">
</asp:ContentPlaceHolder>
</head>
<body>
<form runat="server">
<div class="page">
<div class="clear hideSkiplink">
<asp:Menu ID="NavigationMenu" runat="server" CssClass="menu" EnableViewState="false"
IncludeStyleBlock="false" Orientation="Horizontal">
<Items>
<asp:MenuItem NavigateUrl="~/Default.aspx" Text="Home" />
<asp:MenuItem NavigateUrl="~/About.aspx" Text="About" />
</Items>
</asp:Menu>
</div>
<asp:ContentPlaceHolder ID="MainContent" runat="server" />
</div>
</form>
</body>
</html>
Please help me out that in which page to put these two libraries :
<link href="Styles/demo.css" rel="stylesheet" type="text/css" />
<script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
I have find out answer of my own question so i want to share this with all of you.
I made little changes within Home.aspx
I added Script path
of Image slider in content place holder.
here you can see the difference :