Author: adrianthegasman | Posted on: 1/19/2009 5:12:54 AM | Views : 410

I have a complex class that is capable of populating a placeholder control to form a dynamic user interface. I wish to include a user control in this placeholder. I can manage to do this with the following:

Dim c As New UserControl
c = c.LoadControl("~/controls/DDBrowser.ascx")
UIControls.Add(c)

This seems to work fine in terms of adding it to the placeholder but the problem is that I cannot access any of the user control's properties. I would normally get access to the properties by registering the user control with <%@ Register ... but because this is in a class I cannot do this.

Similarly, when I do a .FindControl on the placeholder to retreive the User Control I cannot do anything with it as I am unable to cast it to anything.

I am using .net 3.5 with VB.

All help appreciated.

Kind regards,

Adrian.
...

Go to the complete details ...