Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #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:
quote:Master Page 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 &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>
        </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.
Reply With Quote
  #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
Default

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

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 02:46 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.