I am using the Wrox Beginning ASP.NET 2.0 with C# book to learn ASP 2 using Visual Studio 2008 beta 2.
Using the book on page 38, I created the About.aspx page. when I switch from Source to Design mode I get the following error:
Quote:
The page has one or more <asp:Content> controls that do not correspond with <asp:ContentPlaceHolder> controls in the Master Page.
mainContent
|
Here is the code from the Master page named "site.master":
Code:
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="site.master.cs" Inherits="MasterPage" Debug="true" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Wrox United</title>
<link rel="stylesheet" type="text/css" href="site.css" runat="server" />
<asp:ContentPlaceHolder id="head" runat="server">
</asp:ContentPlaceHolder>
<style type="text/css">
.style1
{
font-size: x-small;
}
</style>
</head>
<body>
<form id="MainForm" runat="server">
<div id="header">
<div style="width: 100px; height: 100px" id="logo">
<h1>Wrox United</h1>
</div>
</div>
<div id="sidebar">
<h3>Navigation</h3>
</div>
<div id="content">
<div style="width: 100px; height: 100px">
<asp:ContentPlaceHolder id="mainContent" runat="server">
</asp:ContentPlaceHolder>
</div>
<div id="footer">
<p class="style1">Copyright © JT Consulting, LLC 2007 - 2008 </p>
<p class="style1">All content copyright © Wrox Press and its subsidiaries 2006. </p>
<p class="right">
Website designed by
<a href="http://www.jtconsulting.us" title="croak">JT Consulting, LLC</a>
</p>
</div>
</form>
</body>
</html>
Here is the code from the About.aspx page:
Code:
<%@ Page Language="C#" MasterPageFile="~/site.master" AutoEventWireup="true" CodeFile="about.aspx.cs" Inherits="about" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mainContent" Runat="Server">
</asp:Content>
I tried retyping the "mainContent" and got the same results.
I tried copying and pasting the "mainContent" and got the same results.
I tried renaming mainContent to a different name "mainContent1" in both places and got the same results.
I tried deleting the About.aspx page and recreating and got the same results.
What am I doing wrong?
Thanks in Advance,
Jesse Tutterrow
P.S. Sorry to post such long listings, but I don't know what line could be causing the problem.