473,480 Members | 1,745 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Compile error: Make sure that the class defined in this code file.

I've created a project from Microsoft's "club.vsi". I don't want inline code
so I've separated all aspx and ascx pages into code-behind pages. I'm
compiling the project and continue to get this error:

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). It is referring to "LoginBanner" on the first line of the code
below.

public partial class LoginBanner : System.Web.UI.UserControl
{
protected void Logoutbtn_Click(object sender, System.EventArgs e)
{
FormsAuthentication.SignOut();
}
}

This error has plagued my project. It bounces around from ASCX control to
control without any way to predict which it will pick on. I have tried
several suggestions obtained by googling with no success. I do not know what
I've done wrong to cause the compiler to act like this.

I've even tried fully-qualifying the "inherits=" by adding the file name
containing the control, e.g.:

<%@ Control Language="C#" AutoEventWireup="true"
CodeFile="LoginBanner.ascx.cs" Inherits="LoginBanner.LoginBanner" %>

Notice "LoginBanner.LoginBanner". What is really amazing is that I could
change this to:

<%@ Control Language="C#" AutoEventWireup="true"
CodeFile="LoginBanner.ascx.cs" Inherits="LoginBannerXYZ.LoginBanner" %>

and it doesn't complain. It just finds another ASCX control complains about
it the same way. It doesn't even care that LoginBannerXYZ.LoginBanner is
nonsense.

Thanks
Sep 8 '06 #1
1 2035
Hello Larry,

From your description, when you tried modifying the ASP.NET "club" starter
kit's page/usercontrol to make it use separate code-behind file, it
reported some "Compile error: Make sure that the class defined in this code
file..........." error, correct?

Based on my experience, though the error message is quite straightforward,
the actual cause is likely due to some other related compilation setting or
referenced page/usercontrol components.

For the error, would you please paste the complete exception source and
callstack?

Also, since the starter-kit contains many different pages and component
classes, I would suggest you tried isolate the problem by create a
simplifid project whch only contain one or two pages(or with a related
usercontrol) that can reproduct the exact same error behavior. If so, we
can concentrate on that simplief project. If you feel it convenient, you
can send the project to me so that I can perform some local test against it.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Sep 11 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
3093
by: newbiecpp | last post by:
I have hard time to understand run-time environment. Let assume that I have a program that has a simple variable alpha. When this variable is statically allocated, the compiler can use the...
10
4415
by: Jean-David Beyer | last post by:
I have some programs running on Red Hat Linux 7.3 working with IBM DB2 V6.1 (with all the FixPacks) on my old machine. I have just installed IBM DB2 V8.1 on this (new) machine running Red Hat...
4
1975
by: Seok Bee | last post by:
Dear Experts, I've completed my console application and now wants to compile the application and an executable file to be run at another location. However, I've tried compiling that program in...
1
5365
by: electrixnow | last post by:
Help!, I need to compile this code with static libs so it run on another XP machine that does'nt have MS Studio installed. When I compile now I get an ERROR: 1>------ Rebuild All started:...
8
2331
by: mastermagrath | last post by:
Hi, I'm about half way through Bruce Eckels thinking in C++ Vol 1. He gives a very short example of how compiler function name decoration helps remove subtle bugs by type-safe linkage. However,...
5
3155
by: fimarn | last post by:
I am trying to get rid of compile time error that I am getting only in RHEL5 (not in RHEL4) apparently due to the changes in the stl_list.h file. The error that I am getting is coming from the...
11
1738
by: Tim H | last post by:
The following program compiles just fine in C, but not in C++. Can anyone explain why? I have a chunk of code that defines stuff like this in headers (without the extern) that I can not easily...
0
1067
by: tshad | last post by:
I have the following class in my VS 2008 Web Site project that has a namespace of MyFunctions. ********************************* Imports System Imports System.Text.RegularExpressions ...
2
6631
myusernotyours
by: myusernotyours | last post by:
Hi All, Am working on a Java application in which I have to use the JNI to Interface with some native code for both windows and unix. Am using netbeans IDE with the C/C++ pack installed. Am also...
0
6905
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7041
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6736
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6908
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5331
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4772
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
2980
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1299
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
561
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.