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 8th, 2012, 04:30 PM
Registered User
 
Join Date: May 2011
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default Error message

I'm getting this error message when trying to view a page:


Compilation 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).

Source Error:



Line 1:
Line 2: Partial Class MasterPages_Frontend
Line 3: Inherits System.Web.UI.Page
Line 4:



Any Ideas what might be going on, or a fix?


Thanks
Chuck
 
Old October 8th, 2012, 04:36 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I am not entirely sure because you're not providing all the info needed to make an educated guess, but this:

Code:
 
Partial Class MasterPages_Frontend
     Inherits System.Web.UI.Page
seems to suggest that either you have your Master Page's Code Behind inherit from a Page instead of a MasterPage or that your Code Behind doesn't match the Inherits attribute in the Markup of the page (as the error message is hinting at).

Hope this helps. If not, please provide more information, such as a description of the page and its full code.

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 October 16th, 2012, 10:29 AM
Registered User
 
Join Date: May 2011
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Here is my master pages's code behind:

Partial Class MasterPages_Frontend
Inherits System.Web.UI.Page

It's markup:

<%@ Master Language="VB" CodeFile="Frontend.master.vb" Inherits="MasterPages_Frontend" %>

All I did was change -

Partial Class MasterPages_Frontend
Inherits System.Web.UI.Page

to

Partial Class MasterPages_Frontend
Inherits Basepage (makes no sense I know just playing around)

Then back to the orginal
Partial Class MasterPages_Frontend
Inherits System.Web.UI.Page

And now my default and login pages which inherits basepage(or any page that inherits basepage) get the above error.

Thanks
 
Old October 17th, 2012, 10:00 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
All I did was change -

Partial Class MasterPages_Frontend
Inherits System.Web.UI.Page

to
Did you? I think you changed it from:

Partial Class MasterPages_Frontend
Inherits System.Web.UI.MasterPage

as Master Pages inherit MasterPage, not Page.

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:
ChuckZ (October 17th, 2012)
 
Old October 17th, 2012, 02:13 PM
Registered User
 
Join Date: May 2011
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thanks, I'm embarrassed I couldn't see it. Thanks for the allowing me the chance to work this out on my own, just couldn't see it.





Thanks
ChuckZ





Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the error message for a 500 server error? chobo2 C# 2005 1 May 4th, 2008 03:11 AM
ERROR MESSAGE underbuchha Visual C++ 2005 0 September 30th, 2006 02:50 AM
HELP WITH ERROR MESSAGE AnnieT Classic ASP Databases 1 December 22nd, 2004 12:08 AM
Error Message Help?? morpheus Classic ASP Databases 1 April 28th, 2004 10:58 PM
Error Message: renodays ASP.NET 1.0 and 1.1 Basics 2 April 1st, 2004 11:09 AM





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