web usercontrol as property of other classes possible?
i'd like to do some wild thing like this:
imagine a simple page with a navigation menu and an iframe. clicking
on links in the menu loads the according page in the iframe. the menu
is a web-usercontrol of type "MenuList" that uses web-usercontrols of
type "MenuItem" for each link. so far nothing special. but now i'd
like each page that can be loaded to be of an interface/type
"IMenuItem" that publishes a getter for the web-usercontrol of type
"MenuItem", that actually is inserted dynamically into the "MenuList"-
This means ...
1. the page-object has to have a property of type web usercontrol that
is actually not a part of the control-collection of that page.
2. the page itself has to be instanciated somehow to be in some
collection or array of type "IMenuItem" in the "MenuList"-control.
are such things by any means possible? i could not figure out how to
do this, and i know how to dynamicaly load controls into other
controls and pages. but that is not what i want here.
why do i wnat to do such a weird thing anyway? the idea emerged out of
the simple wish to encapsulate code into the right classes, instead of
having an additional class that does all the interface-stuff for each
page or control. having the controls as properties in the objects that
own the data would tidy things up very much!
i would apprechiate any replies that either suggest how to do it or
asure me that this is not possible at all with the current concept of
asp.net or suggest a solution that is different but also helps me
straighten the class layout.
thanks in advance,
|All times are GMT. The time now is 10:40 AM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.