Hi guys
I'm trying to load up a control from a dll dynamically onto my form, but i cannot seem to get it right. Here is some of the codebehind of my form:
VB Code:
' Add the Page Content aPlaceholder = CType(aSkin.FindControl("content"), PlaceHolder) If Not (aPlaceholder Is Nothing) Then Dim aPageContent As UserControl aPageContent = CType(Me.LoadControl(aPage.Content), UserControl) aPlaceholder.Controls.Add(aPageContent) End If
Now the usual way to go about this is to use this LoadControl(VirtualPath) method, and put the usercontrol's virtualpath in the parameter (this value sits in aPage.Content). My problem however, is that this usercontrol exists in another project that has been compiled into a dll and added as a reference to the current project. How can I load up this control??? It does not have a virtual path does it, as it is in the dll?
I could always instantiate this control (which works fine), but then I don't get the graphical elements do I ?
I dont know if i'm missing something small here.
Anybody have any ideas?
Thanks
Patch




Reply With Quote