Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB 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
 
Old June 13th, 2011, 02:32 PM
Registered User
 
Join Date: Jun 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chap. 6, Page 200

I am not sure what I am doing wrong. I have tplaced the code from the Creating Master Page exactly as below:

Code:
<body>
    <form id="form1" runat="server">
     <div id=”PageWrapper”>
     <div id=”Header”><a href=”~/” runat=”server”>Header Goes Here</a></div>
     <div id=”MenuWrapper”>Menu Goes Here</div>
     <div id=”MainContent”>
       <asp:ContentPlaceHolder ID=”cpMainContent” runat=”server”>
       </asp:ContentPlaceHolder>
       </div>
       <div id=”Sidebar”>Sidebar Goes Here</div>
       <div id=”Footer”>Footer Goes Here</div>
       </div>

    </form>
</body>
I get lots of errors, and the Design view states "Error Creating Control - "cpMainContent" No 'runat=server' attribute present on the contentplaceholder tag.

Any light shed will be greatly appreciated.

JP
 
Old June 13th, 2011, 06:48 PM
Registered User
 
Join Date: Jun 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Beats me...

Not sure what happened, but I deleted the file from Solution Explorer, and started over. It works now.
 
Old June 14th, 2011, 07:51 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Did you copy the code from a digital copy of the book? This code:
Code:
 
<asp:ContentPlaceHolder ID=”cpMainContent” runat=”server”>
contains curly quotes (”) rather than straight quotes (").

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old June 14th, 2011, 10:13 AM
Registered User
 
Join Date: Jun 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Yep

That must have been it. After I deleted the Master, I re-created it, and stopped being lazy. I typed the code in, and it worked.





Similar Threads
Thread Thread Starter Forum Replies Last Post
chap 16 Page 631 audreiev BOOK Beginning Linux Programming, 3rd Edition 0 July 7th, 2007 08:40 PM
Chap 19 Page 957 Lostincode BOOK: Ivor Horton's Beginning Visual C++ 2005 1 March 22nd, 2007 05:08 PM
Chap 3 , page 50 MacSr BOOK: Beginning VB.NET Databases 1 January 23rd, 2006 08:53 PM





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