I have researched this error and found several references, but still
nothing solved. Essentially I have:
myUser control in myUser.ascx with codebehind in myUser.ascx.cs
Namespace is myUseruc
myWebForm is myWebForm.aspx with codebehind myWebForm.aspx.cs
myWebForm has an instance of myUser control called myUserInst
In myWebForm.aspx I register the control with:
<%@ Register TagPrefix="uc1" TagName="myUser" src="myUser.scx" %>
and on the page in <form> I have:
<uc1:myUser id="myUser1" runat="server"></uc1:myUser>
The codebehind in myWebForm.aspx.cs includes:
public myUseruc.myUser myUser1;
I also reference the instance of myUser1 in the code to manipulate a
property or call a method, and the intellisense recognizes the object
just fine.
In myUser.ascx I have:
<%@ Control Language="c#" AutoEventWireup="false"
src="myUser.ascx.cs" Inherits="myUseruc.myUser"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5"
classname="myUser" %>
This originally ran OK on my local PC, but I never could get it to
run on our student server. I get the CS0246 error - can't find the
user control reference. Also on my local PC, I no longer get it to
run in start without debug mode -- I get
the "CS1595: 'myUseruc.myUser' is defined in multiple places" error
message.
We (including the instructor, and a Microsoft Rep) are thinking this
is a simple fix, like maybe the incorrect reference to the control. I
read an article that talks about compiling the control. Don't know if
that's it. The Microsoft walkthrough tutorial on user controls does
not explain this problem.