web usercontrol as property of other classes possible?

Discussion in 'ASP .Net' started by Arthur Milfait, Jun 23, 2008.

  1. hey there,

    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"-
    control.
    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,
    arthur
    Arthur Milfait, Jun 23, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fabiano
    Replies:
    2
    Views:
    594
    =?Utf-8?B?c3Jpbmk=?=
    Jun 3, 2005
  2. Tony Johansson

    Nested classes within other classes

    Tony Johansson, Dec 14, 2004, in forum: C++
    Replies:
    2
    Views:
    474
    msalters
    Dec 14, 2004
  3. Replies:
    0
    Views:
    471
  4. Replies:
    7
    Views:
    556
    Alex Hunsley
    Aug 12, 2006
  5. Kan Grewal

    Web Usercontrol in a Web Usercontrol not displaying...

    Kan Grewal, Jul 6, 2004, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    113
    Kan Grewal
    Jul 7, 2004
Loading...

Share This Page