3 Replies - 350 Views - Last Post: 08 January 2020 - 07:25 AM Rate Topic: -----

#1 dongtrien   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 112
  • Joined: 17-June 15

Error: Make sure that the class defined in this code file matches the

Posted 03 January 2020 - 01:00 AM

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 ?
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>



Is This A Good Question/Topic? 0
  • +

Replies To: Error: Make sure that the class defined in this code file matches the

#2 astonecipher   User is offline

  • Senior Systems Engineer
  • member icon

Reputation: 3071
  • View blog
  • Posts: 11,783
  • Joined: 03-December 12

Re: Error: Make sure that the class defined in this code file matches the

Posted 03 January 2020 - 07:06 AM

Where is this file located, MenuLeft.ascx.cs?
Was This Post Helpful? 0
  • +
  • -

#3 dongtrien   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 112
  • Joined: 17-June 15

Re: Error: Make sure that the class defined in this code file matches the

Posted 07 January 2020 - 09:39 PM

View Postastonecipher, on 03 January 2020 - 07:06 AM, said:

Where is this file located, MenuLeft.ascx.cs?


file located:

C:\WebSite2010\Controls\MenuLeft.ascx
C:\WebSite2010\WebMaster\Controls\MenuLeft.ascx
Was This Post Helpful? 0
  • +
  • -

#4 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 7244
  • View blog
  • Posts: 24,556
  • Joined: 05-May 12

Re: Error: Make sure that the class defined in this code file matches the

Posted 08 January 2020 - 07:25 AM

Okay, but those are the .ASCX files. Where are the .ASCX.CS file(s)?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1