Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Beginning ASP.NET 4 : in C# and VB
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 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 February 25th, 2011, 12:12 PM
Authorized User
Points: 445, Level: 7
Points: 445, Level: 7 Points: 445, Level: 7 Points: 445, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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
Reply With Quote
  #2 (permalink)  
Old February 25th, 2011, 02:09 PM
Imar's Avatar
Wrox Author
Points: 72,045, Level: 100
Points: 72,045, Level: 100 Points: 72,045, Level: 100 Points: 72,045, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,083
Thanks: 80
Thanked 1,587 Times in 1,563 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!
Reply With Quote
  #3 (permalink)  
Old February 25th, 2011, 02:47 PM
Authorized User
Points: 445, Level: 7
Points: 445, Level: 7 Points: 445, Level: 7 Points: 445, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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
Reply With Quote
  #4 (permalink)  
Old February 25th, 2011, 04:21 PM
Imar's Avatar
Wrox Author
Points: 72,045, Level: 100
Points: 72,045, Level: 100 Points: 72,045, Level: 100 Points: 72,045, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,083
Thanks: 80
Thanked 1,587 Times in 1,563 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!
Reply With Quote
  #5 (permalink)  
Old February 25th, 2011, 05:01 PM
Authorized User
Points: 445, Level: 7
Points: 445, Level: 7 Points: 445, Level: 7 Points: 445, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2011
Posts: 89
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Brilliant, thanks Imar.
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
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



All times are GMT -4. The time now is 09:36 PM.


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