Solved

Compilation Error

Posted on 2012-03-10
3
303 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 250 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 250 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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

777 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