Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Compilation Error

Posted on 2012-03-10
3
Medium Priority
?
313 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 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

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

688 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