Click here to Skip to main content
Rate this: bad
good
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 22:32pm
Edited 20-Nov-12 22:56pm
v2
Comments
Sk. Tajbir at 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 at 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 at 21-Nov-12 3:40am
   
inside the script tag or... just declare it above the header content tag...
Marla Sukesh at 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
0 OriginalGriff 365
1 Sergey Alexandrovich Kryukov 329
2 BillWoodruff 210
3 Afzaal Ahmad Zeeshan 204
4 CPallini 185
0 OriginalGriff 5,515
1 DamithSL 4,451
2 Maciej Los 3,902
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,175


Advertise | Privacy | Mobile
Web01 | 2.8.141216.1 | Last Updated 21 Nov 2012
Copyright © CodeProject, 1999-2014
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