Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
[HttpException (0x80004005): Cannot find ContentPlaceHolder 'HeadContent' in the master page '/WebSite2/Site.master', verify content control's ContentPlaceHolderID attribute in the content page.] System.Web.UI.MasterPage.CreateMaster(TemplateControl owner, HttpContext context, VirtualPath masterPageFile, IDictionary contentTemplateCollection) +566 System.Web.UI.Page.get_Master() +54 System.Web.UI.Page.ApplyMasterPage() +14 System.Web.UI.Page.PerformPreInit() +45 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +335

my code is as follows

ASP.NET
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="Site.master.cs" Inherits="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 id="Head1"  runat="server">
    <title></title>
    <link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
    <asp:ContentPlaceHolder ID="ContentPlaceHolder2" runat="server">
    

     <style type="text/css">
        .style1
        {
            font-size: x-small;
        }
        .style2
        {
            font-size: small;
            text-decoration: underline;
        }
    </style>
</head>
<body>
    <form id="Form1"  runat="server">
    <div class="page">
        <div class="header">
            <div class="title">
                <h1>
                             <span class="style8">                              </span><span class="style7"><span>
                         class="style2">QUIMZTECH SOLUTIONS</span></span><span class="style1"> </span>
                    <span class="style5"><span class="style1">Imagination / Innovation /Technology</span></span></h1>
            </div>
            <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 Text="Quotation" Value="Quotation">
                            <asp:MenuItem NavigateUrl="~/Quotation.aspx" Text="New Quotation" 
                                Value="New Quotation">
                            <asp:MenuItem NavigateUrl="~/Quotation.aspx" Text="Revise Quotaion" 
                                Value="Revise Quotaion">
                            <asp:MenuItem NavigateUrl="~/SearchQuotation.aspx" Text="Search Quotation" 
                                Value="Search Quotation">
                        
                        <asp:MenuItem Text="Invoice" Value="Invoice">
                            <asp:MenuItem NavigateUrl="~/Invoice.aspx" Text="Search Invoice" 
                                Value="Search Invoice">
                        
                    </items>
                
            </div>
            
        </div>
        <div class="main">
            <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server"/>
            
        </div>
        
        
        <div class="clear">
        <p style="padding: 0px; margin: 0px; font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: 1.5em; font-family: Arial, Helvetica, sans-serif; color: rgb(51, 51, 51); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); height: 0px; width: 1034px;">
                Copyright © Quimztech Solutions 2012.All rights reserved.ved.<span>|</span><a>
                    href="http://www.quimztech.com/sitemap.html" 
                    style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: 1.5em; font-family: Arial, Helvetica, sans-serif; color: rgb(0, 0, 0); text-decoration: none;">Sitemap</a><span>|</span><a>
                    href="http://www.quimztech.com/#" 
                    style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 12px; line-height: 1.5em; font-family: Arial, Helvetica, sans-serif; color: rgb(0, 0, 0); text-decoration: none;">Terms 
                of Use</a></p>
        </div>
        
    </div>
    </form>
</body>
</html>
Posted
Updated 11-Oct-14 2:22am
v2
Comments
[no name] 11-Oct-14 8:15am    
Please learn how to format your code. The error message is self explanatory is it not? Where in your code do you see a ContentPlaceHolder named 'HeadContent'?

1 solution

Quote:
Cannot find ContentPlaceHolder 'HeadContent' in the master page '/WebSite2/Site.master', verify content control's ContentPlaceHolderID attribute in the content page.
That means you have control which have the property ContentPlaceHolderID as HeadContent, but unfortunately it is not in the Master Page.

So, either use correct ContentPlaceHolderID, which is in Master Page or just rename the ContentPlaceHolderID
 
Share this answer
 

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



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