 |
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
|
|
|
|
|

August 25th, 2011, 03:58 PM
|
|
Authorized User
|
|
Join Date: Apr 2011
Posts: 11
Thanks: 4
Thanked 0 Times in 0 Posts
|
|
Chapter 7 pg. 254-255
I just completed step 3 of the Try It Out titled "Styling the Menu Control" that begins on pg. 253. I added all the files by clicking the My BasePage template, renaming them appropriately, and then clicking Add. That's point of the Base Page, right? To use the template we created when we are importing new Wed Forms so we don't have to change code every time we make a new Web Form.
Now, for each file I imported I am getting the following warning: C:\BegASPNET\Site\Reviews\Default.aspx: ASP.NET runtime error: Only Content controls are allowed directly in a content page that contains Content controls.
When I go to view the site in my browser initially everything works correctly, all the styling is correct, but when I navigate to one of the new pages I just created is step 3 of the Try It Out I get a server error similar to this :
Server Error in '/' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: The server block is not well formed.
Source Error:
Line 1: <%@ Page Title="Reviews Grouped by Genre" Language="C#" MasterPageFile="~/MasterPages/Frontend.master"
Line 2: AutoEventWireup="true" CodeFile="AllByGenre.aspx.cs"
Line 3: Inherits="Reviews_AllByGenre"" %>
Source File: /Reviews/AllByGenre.aspx Line: 1
NOTE: I HAVE ADDED TITLES TO ALL THE NEW PAGES, as you can see in the error message, it does have a title.
The 'Common Mistakes" message at the end of the Try It Out only mentioned forgetting to give names to the new pages as a possible reason for errors occurring upon navigation to the new pages.
Does anyone know what I did wrong? I've been doing everything by the book the whole way so far, so everything should be named according to how the book specifies.
Thanks
|
|

August 25th, 2011, 06:00 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
There appears to be a double double quote after AllByGenre. Maybe the quote was already there when you created the template?
Cheers,
Imar
|
|

August 25th, 2011, 06:08 PM
|
|
Authorized User
|
|
Join Date: Apr 2011
Posts: 11
Thanks: 4
Thanked 0 Times in 0 Posts
|
|
Thanks Imar, I removed the extra quote from all the pages manually and it worked. Is there any easy way to edit the base page and get rid of the extra double quote?
|
|

August 25th, 2011, 06:12 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
You could recreate the template as described in the book, or update the file in the template's zip file directly. For a simple template like this, the former is probably the easiest.
Cheers,
Imar
|
|
The Following User Says Thank You to Imar For This Useful Post:
|
|
|
 |
|