Error: Make sure that the class defined in this code file matches the 'inherits' attr
The website is working fine now I added MenuLeft.ascx into the folder "C:\WebSite2010\WebMaster\Controls" when pressing the Rebuild website button with the error "Error: C:\WebSite2010\WebMaster\Controls\MenuTop.ascx.cs(14): error 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)". Note that the folder "C:\WebSite2010\Controls" already has a file with the same file name: MenuLeft.ascx now I copy the declaration of 2 files with the same name, how do I change the code ?
Code:
in the file: C:\WebSite2010\Controls\MenuLeft.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="MenuLeft.ascx.cs" Inherits="MenuLeft" %>
<%@ Import Namespace="webapp4U" %>
<%@ Register Src="~/Controls/ThuvienHinhAnh.ascx" TagPrefix="uc" TagName="ThuvienHinhAnh" %>
<%@ Register Src="~/Controls/QuangCaoLeft.ascx" TagPrefix="uc" TagName="QuangCaoLeft" %>
<%@ Register Src="~/Controls/WebURL.ascx" TagPrefix="uc" TagName="WebURL" %>
<%@ Register Src="~/Controls/Newsletter.ascx" TagPrefix="uc" TagName="Newsletter" %>
<%@ Register src="DanhMucBDS.ascx" tagname="DanhMucBDS" tagprefix="uc" %>
<%@ Register TagPrefix="webapp4U" Namespace="webapp4U.UI" %>
<table cellspacing="0" cellpadding="0" width="180" border="0">
...
</table>
in the file: C:\WebSite2010\WebMaster\Controls\MenuLeft.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="MenuLeft.ascx.cs" Inherits="MenuLeft" %>
<%@ Import Namespace="webapp4U" %>
<table width="185px" border="0" cellpadding="0" cellspacing="0">
...
</table>
Re: Error: Make sure that the class defined in this code file matches the 'inherits'
Where is the MenuLeft.ascx.cs file?
Re: Error: Make sure that the class defined in this code file matches the 'inherits'
file located:
C:\WebSite2010\Controls\MenuLeft.ascx
C:\WebSite2010\WebMaster\Controls\MenuLeft.ascx
Re: Error: Make sure that the class defined in this code file matches the 'inherits'
Quote:
Originally Posted by
dongtrien
file located:
C:\WebSite2010\Controls\MenuLeft.ascx
C:\WebSite2010\WebMaster\Controls\MenuLeft.ascx
Not the file I asked for. Where is the MenuLeft.ascx.cs file?