referencing control from other webcontrol

Discussion in 'ASP .Net Web Controls' started by karimL, Feb 9, 2004.

  1. karimL

    karimL Guest

    hi,
    could you help me on this ?
    i've got a webcontrol that have an other webcontrol as a private member.
    I want this private member be accessible from my "container" control as
    a property...but it seems not to work at design time...
    Once I edited and closed my custom "contained" control , all its
    properties are lost and then the "container" control cannot "save" its
    properties too...
    Shall I have to do something special ?

    The "contained" control ...

    [
    ToolboxData("<{0}:LBC_ToolBar runat=server></{0}:LBC_ToolBar>")
    ,ToolboxItem(true)
    ,DesignTimeVisible(true)
    ,ParseChildren(true)
    ,PersistChildren(false)
    ]
    public class LBC_ToolBar: WebControl, INamingContainer


    and for the collection property

    [DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
    PersistenceMode(PersistenceMode.InnerProperty),
    NotifyParentProperty(true)
    ]
    public LBC_ToolBarItemCollection Items
    {
    get
    {
    if(_itemlist==null)
    _itemlist=new LBC_ToolBarItemCollection();
    return _itemlist;
    }
    }



    the "container" control...

    [
    ToolboxData("<{0}:LBC_Thumbnail runat=server></{0}:LBC_Thumbnail>")
    ]
    public class LBC_Thumbnail : WebControl, INamingContainer
    {

    public LBC_LIB.WebControls.ToolBar.LBC_ToolBar ToolBarDatas
    {
    get { EnsureChildControls(); return _toolbar; }
    }


    protected override void CreateChildControls()
    {
    if ( _toolbar==null)
    {
    _toolbar= new LBC_LIB.WebControls.ToolBar.LBC_ToolBar();
    _toolbar.ID="TB_"+this.UniqueID;
    }
    }


    }



    thanks
    Karim
    karimL, Feb 9, 2004
    #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. Guest
    Replies:
    2
    Views:
    716
  2. Luis Ramírez.

    Can a webcontrol (webcontrol.dll) have a configuration file?

    Luis Ramírez., Jul 5, 2004, in forum: ASP .Net Building Controls
    Replies:
    2
    Views:
    175
    Luis Ramírez
    Jul 6, 2004
  3. Kasabaarde Sumta

    WebControl inside of WebControl and attaching events

    Kasabaarde Sumta, Dec 13, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    169
    Kasabaarde Sumta
    Dec 13, 2004
  4. Fabricio

    Custom webcontrol that references another webcontrol

    Fabricio, Sep 21, 2005, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    160
    Fabricio
    Sep 21, 2005
  5. Peter Morris [Air Software Ltd]

    WebControl with non-WebControl property

    Peter Morris [Air Software Ltd], Dec 7, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    123
    Peter Morris [Air Software Ltd]
    Dec 7, 2004
Loading...

Share This Page