Click here to Skip to main content
12,511,896 members (44,821 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: jQuery
Master page content

<html xmlns="http://www.w3.org/1999/xhtml">
 
<head runat="server">
    <title>Untitled Page</title>
    <script src="js/jquery-1.8.2.min.js" type="text/javascript"></script>
 
    <link href="styles/Header.css" rel="stylesheet" type="text/css" />
 
    <asp:ContentPlaceHolder id="head" runat="server">
 
    </asp:ContentPlaceHolder>
 

</head>
<body>
    <form id="form1" runat="server">
    <div>
   <div id ="header">
 
          <asp:Image ID="Image1" runat="server" ImageUrl="~/Images/NkBhat.JPG" />
        <asp:LinkButton ID="LinkButton1" class="contact" runat="server">Contact Us</asp:LinkButton>
        <asp:LinkButton ID="LinkButton2" class="careers" runat="server">Careers</asp:LinkButton>
     </div>
     <div id ="menu">
         <ul>
              <li><a href="#">Home</a></li>
              <li><a href="#">About Us</a></li>
              <li><a href = "#">Services</a></li>
              <li><a href="#">Industries</a></li>
              <li><a href="#">Solutions</a></li>
         </ul>
 
     </div>
        <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
 
        </asp:ContentPlaceHolder>
    </div>
    </form>
</body>
</html>


Child page

<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Home.aspx.cs" Inherits="pages_Home" Title="Untitled Page" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
 
<script src="js/JScript.js" type="text/javascript"></script>
 
</asp:Content>
 
<asp:Content ID="Content2" runat="server" contentplaceholderid="ContentPlaceHolder1">
 

</asp:Content>
Posted 20-Nov-12 21:32pm
Updated 20-Nov-12 21:56pm
v2
Comments
Sk. Tajbir 21-Nov-12 3:41am
   
Can you specify more about child page which is inheriting this master page ? also please don't include jquery library in the child page.
sathish k.kumar 21-Nov-12 3:53am
   
yeah..

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Add JS file programaticaly and try

Dim ObjLocJsForJquery = New HtmlGenericControl()
          ObjLocJsForJquery.TagName = "script"
          ObjLocJsForJquery.Attributes.Add("type", "text/javascript")
          ObjLocJsForJquery.Attributes.Add("language", "javascript")
          ObjLocJsForJquery.Attributes.Add("src", Page.ResolveClientUrl("~/Js/jquery-1.8.2.min.js"))
          Page.Header.Controls.Add(ObjLocJsForJquery)
And Check.
  Permalink  
Comments
sathish k.kumar 21-Nov-12 3:40am
   
inside the script tag or... just declare it above the header content tag...
Marla Sukesh 21-Nov-12 4:17am
   
write in Page load

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160929.1 | Last Updated 21 Nov 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100