G
Guest
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
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