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 October 17th, 2010, 09:48 AM
Authorized User
Points: 267, Level: 5
Points: 267, Level: 5 Points: 267, Level: 5 Points: 267, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2010
Posts: 56
Thanks: 17
Thanked 2 Times in 2 Posts
Default Ch9 Page 303 - Build error

When I get to step 10 and press Ctrl+F5 I get the following build error.


Error 1 '_$safeitemnames$' is not a valid value for attribute 'inherits'. C:\BegASPNET\Site\MyBasePage.aspx 1

Here is the code for MyBasePage - it looks to be the sames as that in the download.

Note: The "_$safeitemnames$" in the code behind has a red underline with the error message: "The type or namespace 'safeitemnames' could not be found."


Any clues?

Thanks
Ken

Code:
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/Frontend.master" AutoEventWireup="true" CodeFile="MyBasePage.aspx.cs" Inherits="_$safeitemnames$" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" Runat="Server">
</asp:Content>
and the code behind
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _$safeitemnames$: BasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
}
the complete error list
Code:
Error	1	'_$safeitemnames$' is not a valid value for attribute 'inherits'.	C:\BegASPNET\Site\MyBasePage.aspx	1	
Error	5	{ expected	C:\BegASPNET\Site\MyBasePage.aspx.cs	8	23	C:\BegASPNET\Site\
Error	4	Invalid token '$' in class, struct, or interface member declaration	C:\BegASPNET\Site\MyBasePage.aspx.cs	8	23	C:\BegASPNET\Site\
Error	6	Invalid token '$' in class, struct, or interface member declaration	C:\BegASPNET\Site\MyBasePage.aspx.cs	8	37	C:\BegASPNET\Site\
Error	7	Invalid token '{' in class, struct, or interface member declaration	C:\BegASPNET\Site\MyBasePage.aspx.cs	9	1	C:\BegASPNET\Site\
Error	8	The type or namespace name 'safeitemnames' could not be found (are you missing a using directive or an assembly reference?)	C:\BegASPNET\Site\MyBasePage.aspx.cs	8	24	C:\BegASPNET\Site\
Error	2	Unexpected character '$'	C:\BegASPNET\Site\MyBasePage.aspx.cs	8	23	C:\BegASPNET\Site\
Error	3	Unexpected character '$'	C:\BegASPNET\Site\MyBasePage.aspx.cs	8	37	C:\BegASPNET\Site\

Last edited by ken evans; October 17th, 2010 at 09:51 AM.. Reason: more errors
 
Old October 17th, 2010, 09:56 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Is this the page you used as the basis for the new template? If so, you can delete it as instructed in the book.

If this page is the *result* of your new template (e.g. when you choose Add New Item), something is wrong with the template file.

Cheers,

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!
The Following User Says Thank You to Imar For This Useful Post:
ken evans (October 17th, 2010)
 
Old October 17th, 2010, 10:12 AM
Authorized User
Points: 267, Level: 5
Points: 267, Level: 5 Points: 267, Level: 5 Points: 267, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2010
Posts: 56
Thanks: 17
Thanked 2 Times in 2 Posts
Default

OK, I deleted MyBasePage and the error has gone away.
Thanks
Ken





Similar Threads
Thread Thread Starter Forum Replies Last Post
Build Error venessaz BOOK: Beginning Spring Framework 2 ISBN: 978-0-470-10161-2 46 March 30th, 2016 12:25 PM
Error in Monthly Calendar Report (Ch9) mruschetti BOOK: Expert Access 2007 Programming ISBN 978-0-470-17402-9 6 May 7th, 2008 11:43 PM
CH9 - Apache not using custom error page d2nash BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 3 June 20th, 2006 11:25 AM
Build a page dynamically jbenson001 ASP.NET 1.x and 2.0 Application Design 13 June 20th, 2005 12:12 PM
error on build stewbaby C++ Programming 1 October 30th, 2003 06:07 PM





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