M
martin
Hi,
I am attemping to write a composite control but have so far not achieved the
results that I am looking for and would appreciate some advice.
By a composite control, i mean, a Web User control that has another web user
control passed to it as one of the arguments in the containing aspx page.
For example say I have a web page MyPage.aspx
Inside MyPage.aspx I have a user control "Control1.ascx"
I have another user control "Control2.ascx" that I would like to include in
Control1, I do not want to hard code "Control2.ascx" inside "Control1.ascx"
because in another page I might want to pass "Control3.ascx" as an argument
to "Control1.ascx"
My prolem is how to make a user control an arument to another control.
The best method I have come up with so far is to pass the path of user
"control2.ascx" to "Control1.ascx" as an argument of type string and then
use "Loadcontrol" to dynamically load the control, but this way seems messy
to me (as well as a little difficult to master..) so I was hoping for some
advice off anybody who had achieved a similar thing.
cheers
martin.
I am attemping to write a composite control but have so far not achieved the
results that I am looking for and would appreciate some advice.
By a composite control, i mean, a Web User control that has another web user
control passed to it as one of the arguments in the containing aspx page.
For example say I have a web page MyPage.aspx
Inside MyPage.aspx I have a user control "Control1.ascx"
I have another user control "Control2.ascx" that I would like to include in
Control1, I do not want to hard code "Control2.ascx" inside "Control1.ascx"
because in another page I might want to pass "Control3.ascx" as an argument
to "Control1.ascx"
My prolem is how to make a user control an arument to another control.
The best method I have come up with so far is to pass the path of user
"control2.ascx" to "Control1.ascx" as an argument of type string and then
use "Loadcontrol" to dynamically load the control, but this way seems messy
to me (as well as a little difficult to master..) so I was hoping for some
advice off anybody who had achieved a similar thing.
cheers
martin.