Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old December 10th, 2007, 01:49 AM
Registered User
Join Date: Dec 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default VS2008 Master page error in <asp:contentPlaceHolde

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:Master Page error
The page has one or more <asp:Content> controls that do not correspond with <asp:ContentPlaceHolder> controls in the Master Page.
Here is the code from the Master page named "site.master":

<%@ 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">
    <style type="text/css">
            font-size: x-small;
    <form id="MainForm" runat="server">
    <div id="header">
        <div style="width: 100px; height: 100px" id="logo">
            <h1>Wrox United</h1>
    <div id="sidebar">
    <div id="content">
        <div style="width: 100px; height: 100px">
            <asp:ContentPlaceHolder id="mainContent" runat="server">

    <div id="footer">
        <p class="style1">Copyright &copy; JT Consulting, LLC 2007 - 2008 </p>
        <p class="style1">All content copyright &copy; 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>
Here is the code from the About.aspx page:
<%@ 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 ID="Content2" ContentPlaceHolderID="mainContent" Runat="Server">
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.
  #2 (permalink)  
Old December 10th, 2007, 12:17 PM
Registered User
Join Date: Dec 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

Follow-up on my post.

After encountering the problem Sunday night, I exited VS2008, and shutdown the virutal machine. This morning when I booted and entered VS2008 the problem had disappeared. I can cause the problem at will, and always solve it by exiting and starting VS2008.

So, this must be a feature from Microsoft. I wonder if purchasers of Visual Studio are charged extra for this feature? Yes this is a sarcastic comment. As a beginner to ASP I don't really need to spend over 3 hours trying to debug something like this, and assuming that I had made a mistake.

Now I need to figure out how to report this to Microsoft.

Thanks, Jesse

Similar Threads
Thread Thread Starter Forum Replies Last Post
Master Page error michaelhruby BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 3 December 3rd, 2008 04:25 PM
ASP Wizard on Master Page AspNetGuy BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 3 June 5th, 2008 09:19 AM
Using Master Page in ASp.net 2.0 dilipv .NET Framework 2.0 1 March 4th, 2008 07:00 AM
ASP.NET and Master Page ayazhoda ASP.NET 2.0 Basics 5 May 14th, 2007 04:22 PM
JScripts on ASP.NET Master page? woojtii Javascript How-To 0 March 28th, 2007 05:54 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.