Click here to Skip to main content
13,093,097 members (78,501 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Master page content

<html xmlns="">
<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">

    <form id="form1" runat="server">
   <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 id ="menu">
              <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>
        <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">

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 ID="Content2" runat="server" contentplaceholderid="ContentPlaceHolder1">

Posted 20-Nov-12 21:32pm
Updated 20-Nov-12 21:56pm
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

1 solution

Rate this: bad
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"))

And Check.
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 |
Web02 | 2.8.170813.1 | Last Updated 21 Nov 2012
Copyright © CodeProject, 1999-2017
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