Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Compilation Error

Posted on 2012-03-10
3
Medium Priority
?
315 Views
Last Modified: 2012-03-12
Hello!

I have a page called MoneyFirst.aspx. First line is this:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="MoneyFirst.aspx.vb" Inherits="MoneyFirst" MasterPageFile="~/MasterPages/TemplateSeven.master" %>

and the code behind file (MoneyFirst.aspx.vb) contains this:


Partial Class MoneyFirst
    Inherits System.Web.UI.Page

End Class

But I still get this error:

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 MoneyFirst
Line 3:      Inherits System.Web.UI.Page
Line 4:  
 
What am I doing wrong?!

Thanks.
0
Comment
Question by:pvg1975
3 Comments
 
LVL 18

Accepted Solution

by:
Jerry Miller earned 1000 total points
ID: 37705970
Are the files in a folder other than the root of the site? You may have to reference the folder name in front of hte file name. I looked at several of my pages and they all reference the folder name in front of the file.

CodeBehind="About.aspx.vb" Inherits="WebSite.About"

I am not sure why that is, but I built this site from a template. Anything that I have in the root folder of the site is just like you have it, but anything in a folder references the folderName.fileName
0
 
LVL 16

Assisted Solution

by:Easwaran Paramasivam
Easwaran Paramasivam earned 1000 total points
ID: 37710385
Changing the attribute from "codefile" to "codebehind", should do the trick.

Please do refer http://tek-wise.blogspot.com/2009/07/aspnet-make-sure-that-class-defined-in.html
0
 

Author Closing Comment

by:pvg1975
ID: 37710503
Thanks guys!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question