-
January 3rd, 2020, 02:45 AM
#1
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>
-
January 3rd, 2020, 11:13 AM
#2
Re: Error: Make sure that the class defined in this code file matches the 'inherits'
Where is the MenuLeft.ascx.cs file?
-
January 7th, 2020, 11:17 PM
#3
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
-
January 8th, 2020, 12:28 AM
#4
Re: Error: Make sure that the class defined in this code file matches the 'inherits'
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?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|