Solved

Compilation Error

Posted on 2012-03-10
3
302 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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks guys!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

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…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now