Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Beginning ASP.NET 4 : in C# and VB
|
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 February 25th, 2011, 12:12 PM
Authorized User
 
Join Date: Jan 2011
Posts: 89
Thanks: 1
Thanked 0 Times in 0 Posts
Default error parsing attribute 'page' & compilation error

Hi all,

I'm just creating the DarkGrey and Monochrome App_Themes and I'm getting a couple of problems:

1) My error list window is coming up with 4 of the same errors stating:
Error parsing attribute 'page': Cannot create an object of type 'System.Web.UI.Page' from its string representation " for the 'Page' property.

The page declaration is:
<%@ Title="Planet Wrox" Page Language="VB" AutoEventWireup="false" CodeFile="CSSDemo.aspx.vb" Inherits="Demos_CSSDemo" %>

2) After changing the Web.Config file to include:
<pages theme="Monochrome" styleSheetTheme="Monochrome"></pages>

I now get a page error:

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: ASPNET: Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl).

It points to line 2:
Line 2: Partial Class MasterPages_FrontEnd
Source File: C:\begASPNET\Site\MasterPages\FrontEnd.master.vb Line: 2
 
Old February 25th, 2011, 02:09 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Looks like something is wrong with the page or master page.

Can you post - for both, the @ directive and the Code Behind?

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 February 25th, 2011, 02:47 PM
Authorized User
 
Join Date: Jan 2011
Posts: 89
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi Imar,

Master page directive:
<%@ Master Language="VB" CodeFile="FrontEnd.master.vb" Inherits="MasterPages_FrontEnd" %>

Master Code behind:

Partial Class MasterPages_FrontEnd
Inherits BasePage
End Class

Default page directive:
<%@ Page Title="Planet Wrox" Language="VB" MasterPageFile="~/MasterPages/FrontEnd.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

Default code behind:


Partial Class _Default
Inherits BasePage

End Class
 
Old February 25th, 2011, 04:21 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Alex,

Take a look at this:
Code:
 
 
Partial Class MasterPages_FrontEnd
      Inherits BasePage
End Class
Master pages shouldn't inherit your custom base page (which is for Pages only). Change the Inherits line back to MasterPage and it should work again.

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!
 
Old February 25th, 2011, 05:01 PM
Authorized User
 
Join Date: Jan 2011
Posts: 89
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Brilliant, thanks Imar.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting error XML Parsing Error: junk after document element anarleti XSLT 10 March 17th, 2010 08:43 AM
Error: Microsoft VBScript compilation error '800a0409' webXtreme Classic ASP Basics 4 February 4th, 2009 03:58 AM
Compilation Error jotnarta JSP Basics 1 March 23rd, 2007 07:14 AM
Compilation Error allyant ASP.NET 2.0 Basics 1 August 5th, 2006 05:51 PM
Compilation Error with ASP.Net 2.0 & IIS 5.1 gmitchell7 ASP.NET 2.0 Basics 0 April 17th, 2006 04:52 PM





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