R
Richard Wangler
Firstly I am not using codebehind. All code is in the aspx and ascx.
I have a main.aspx page with the following web control;
<asplaceholder ID="DynamicUserControl" runat="server" />
In the page_load of the main.aspx I dynamically load the usercontrol;
DynamicUserControl.Controls.Add(LoadControl("Services/massages.ascx"));
This works fine!
-------------------------
My problem is that massages.ascx has a custom property called
'ImageName' that I need to set.....and I cant figure out how to get a
reference to the actual ascx object.
-------------------------
Essentially what I 'want' to do in the main.aspx page_load is this;
Control objMyControl = LoadControl("Services/massages.ascx");
objMyControl.ImageName = "blahblah.jpg";
DynamicUserControl.Controls.Add(objMyControl);
I have a main.aspx page with the following web control;
<asplaceholder ID="DynamicUserControl" runat="server" />
In the page_load of the main.aspx I dynamically load the usercontrol;
DynamicUserControl.Controls.Add(LoadControl("Services/massages.ascx"));
This works fine!
-------------------------
My problem is that massages.ascx has a custom property called
'ImageName' that I need to set.....and I cant figure out how to get a
reference to the actual ascx object.
-------------------------
Essentially what I 'want' to do in the main.aspx page_load is this;
Control objMyControl = LoadControl("Services/massages.ascx");
objMyControl.ImageName = "blahblah.jpg";
DynamicUserControl.Controls.Add(objMyControl);