suppose I declare a usercontrol. I put it in my root folder. Then I use visual studio to drag it to a webpage. Normally, in the code-behind page, I could just refer to it as:
me.myusercontrol.
However, my codebehind page is shared between several similar asp pages, some of which don't have the control.
So I thought I could do this:
Dim thecontrol As Control
thecontrol = Me.FindControl("ucplayer")
If thecontrol Is Nothing Then
....error
End If
Dim uctp As UserControlTextPlayer
uctp = CType(thecontrol, UserControlTextPlayer)
But interestingly, when I do this, the line that has the dim statement fails, saying that "UserControlTextPlayer" is unrecognized.
One solution is to make a separate code-behind page for this asp page (that has the control).&n ...
Go to the complete details ...