G
Guest
I have made some user controls with custom properties. I can set those
properties on instances of my user controls, and I have programmed my user
control to do useful visual things in response to how those properties are
set.
I want to be able to do two other things:
a) add User control instances to my page, filling in the place of
placeholder controls, and
b) programmatically setting custom properties on those dynamically spawned
instances of my user controls. At the end of all of this I'm hoping I will
be able to determin the value of those custom properties at runtime as well.
So far I have managed to figure out how to do a), adding UC's to my page and
subbing them in for placeholder controls, as follows:
Control Uwn_ImageBox =
LoadControl("~/App_UserControls/Presentational/Uwn_ImageBox.ascx");
PlaceHolder1.Controls.Add(Uwn_ImageBox);
I have not figured out how to do b). It does not seem like VS.NET has
support for dynamically/programmatically placed UC's loaded via LoadControl,
which is not so surprising. However, I cannot figure out how to add/load
custom properties that I've developed for my UC.
Can some offer some insight here? Is what I'm hoping to do possible?
Thanks,
-KF
properties on instances of my user controls, and I have programmed my user
control to do useful visual things in response to how those properties are
set.
I want to be able to do two other things:
a) add User control instances to my page, filling in the place of
placeholder controls, and
b) programmatically setting custom properties on those dynamically spawned
instances of my user controls. At the end of all of this I'm hoping I will
be able to determin the value of those custom properties at runtime as well.
So far I have managed to figure out how to do a), adding UC's to my page and
subbing them in for placeholder controls, as follows:
Control Uwn_ImageBox =
LoadControl("~/App_UserControls/Presentational/Uwn_ImageBox.ascx");
PlaceHolder1.Controls.Add(Uwn_ImageBox);
I have not figured out how to do b). It does not seem like VS.NET has
support for dynamically/programmatically placed UC's loaded via LoadControl,
which is not so surprising. However, I cannot figure out how to add/load
custom properties that I've developed for my UC.
Can some offer some insight here? Is what I'm hoping to do possible?
Thanks,
-KF