Controls with subcontrols invisible outside the controle, how can I do it?

Discussion in 'ASP .Net Web Controls' started by ThunderMusic, Sep 7, 2006.

  1. ThunderMusic

    ThunderMusic Guest

    Hi,
    I've already seen this thing in here, but can't find it anymore... What I
    need to do is the following :

    <test:MyControl>
    <test:MySubControl />
    <test:MySubControl />
    </test:MyControl>

    actually 2 questions :
    1) How can I do it so when I press < between both <test:MyControl> tags only
    <test:MySubControl> appears? right now I can do it with an in between
    element using ParseChildren(true) and PersistChildren(true) on the control
    class and PersistMode(PersistModes.innerProperty) on the property that
    contains the subcontrols...

    2) How can I hide <test:MySubControl> from the other context? I mean, I want
    it to be visible only when I'm between <test:MyControl> and
    </test:MyControl>...

    Can it be done? I'm pretty sure it can because 1) asp:DropDownList does it
    and 2) asp:ListItem can only be a subcontrol (to DropDownList as example)

    thanks

    ThunderMusic
     
    ThunderMusic, Sep 7, 2006
    #1
    1. Advertising

  2. ThunderMusic

    ThunderMusic Guest

    ok, I found the answer for question #1 : ParseChildren(true,
    "MyCollectionProperty"), PersistChildren(false) on the class and
    PersistMode(PersistModes.Attribute) on the 'MyCollectionProperty'... ;)

    now, someone knows about question #2?

    thanks

    ThunderMusic

    "ThunderMusic" <> wrote in message
    news:...
    > Hi,
    > I've already seen this thing in here, but can't find it anymore... What I
    > need to do is the following :
    >
    > <test:MyControl>
    > <test:MySubControl />
    > <test:MySubControl />
    > </test:MyControl>
    >
    > actually 2 questions :
    > 1) How can I do it so when I press < between both <test:MyControl> tags
    > only <test:MySubControl> appears? right now I can do it with an in between
    > element using ParseChildren(true) and PersistChildren(true) on the control
    > class and PersistMode(PersistModes.innerProperty) on the property that
    > contains the subcontrols...
    >
    > 2) How can I hide <test:MySubControl> from the other context? I mean, I
    > want it to be visible only when I'm between <test:MyControl> and
    > </test:MyControl>...
    >
    > Can it be done? I'm pretty sure it can because 1) asp:DropDownList does it
    > and 2) asp:ListItem can only be a subcontrol (to DropDownList as example)
    >
    > thanks
    >
    > ThunderMusic
    >
     
    ThunderMusic, Sep 7, 2006
    #2
    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. Gabriel Lozano-Morán

    Adding resource files to a form or user controle

    Gabriel Lozano-Morán, Sep 9, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    2,370
    Rolf Molini
    Sep 18, 2005
  2. Brent
    Replies:
    6
    Views:
    1,866
    Brian Henry
    Jul 10, 2004
  3. Rolf Welskes
    Replies:
    4
    Views:
    357
    Rolf Welskes
    Oct 9, 2006
  4. John Devlon

    Disable validater controle by code

    John Devlon, Apr 17, 2008, in forum: ASP .Net
    Replies:
    4
    Views:
    307
    John Devlon
    Apr 17, 2008
  5. Andy B
    Replies:
    5
    Views:
    628
    Andy B
    May 29, 2008
Loading...

Share This Page