Dong Lam Trien

Dong Lam Trien

  • 778
  • 968
  • 134k

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

Jan 3 2020 1:34 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
  1. <%@ Control Language="C#" AutoEventWireup="true" CodeFile="MenuLeft.ascx.cs" Inherits="MenuLeft" %>  
  2. <%@ Import Namespace="webapp4U" %>  
  3. <%@ Register Src="~/Controls/ThuvienHinhAnh.ascx" TagPrefix="uc" TagName="ThuvienHinhAnh" %>  
  4. <%@ Register Src="~/Controls/QuangCaoLeft.ascx" TagPrefix="uc" TagName="QuangCaoLeft" %>  
  5. <%@ Register Src="~/Controls/WebURL.ascx" TagPrefix="uc" TagName="WebURL" %>  
  6. <%@ Register Src="~/Controls/Newsletter.ascx" TagPrefix="uc" TagName="Newsletter" %>  
  7. <%@ Register src="DanhMucBDS.ascx" tagname="DanhMucBDS" tagprefix="uc" %>  
  8. <%@ Register TagPrefix="webapp4U" Namespace="webapp4U.UI" %>  
  9. <table cellspacing="0" cellpadding="0" width="180" border="0">  
  10. ...  
  11. </table>  
  12. in the file: C:\WebSite2010\WebMaster\Controls\MenuLeft.ascx  
  13. <%@ Control Language="C#" AutoEventWireup="true" CodeFile="MenuLeft.ascx.cs" Inherits="MenuLeft" %>  
  14. <%@ Import Namespace="webapp4U" %>  
  15. <table width="185px" border="0" cellpadding="0" cellspacing="0">  
  16. ...  
  17. </table>  

Answers (2)