Solved

Compilation Error

Posted on 2012-03-10
3
307 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

729 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