Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HELP! Compilation Error - .NET newbie

Status
Not open for further replies.

iteach2

Technical User
Sep 16, 2001
120
US
Hi Gurus,

I just inherited a .net app and I am a PHP programmer. THe error looks like this:

Server Error in '/' Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

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: Partial Class Admin_Default
Line 2: Inherits System.Web.UI.Page
Line 3: Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load


I have not programmed in .net before but I know a bit about it. Any ideas why this error is happening? Does it mean I am missing a class call "Admin_Default" or maybe its misnamed?

Please advise...
 
It's been a few months since I messed with webforms, if I recall correctly the marup file (aspx) is not properly inheriting the code behind (aspx.vb)

looking at the name of the class I assume you have an Admin directory and there is a webform named Default.aspx.

open Default.aspx and look at the 1st line in the file. It should be a page declaration line something like
Code:
<@%Page ... %>
Then open the Default.aspx.vb )<F7> in VS). this should open the Admin_Default class. also make sure the Default.aspx.Designer.vb file has the same class as your Default.aspx.vb file. both classes should have the 'partial' keyword.
Code:
public partial class Admin_Default Inherits Page
end class // or however vb closes a class
This is where I would start

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top