If you need to quickly fix the problem, you will need to provide new names on all the pages and controls that you copied. The error occurs due to the presence of two user controls with the same name (exactly the same as said).
However, everyone else is true that you are doing it wrong. What happens when you need to change some code? This will cause additional maintenance because you need to make changes in two places. Most likely, you will forget it, and you will end up spending a lot of time. If you invest in using language resource files now, you can save on headaches later. And I donβt even mention the possibility of adding an additional language on the road.
Edit
Try the following if you still do not want to use language resource files.
- Put the non-language specific code in a separate .cs file. Make sure it inherits from
System.Web.UI.UserControl - In ASCX 1, make sure the ascx.cs class inherits from your class created in step 1.
- In ASCX 2, make sure its ascx.cs class inherits from your class created in step 2.
source share