How to create server control of Container Type

Ask a Question related to ASP.NET Building Controls, Design and Development.

  1. #1

    Default How to create server control of Container Type

    Hi All,

    I am trying to build one server control which has one panel and within
    this panel there will be two more panel. I have created two instance of
    MyPanel class (inherited by Panel), it works fine in design as well as
    runtime. The problem is I want user to be able to add controls on
    designtime to the inner panel. Can any body tell me how to achieve
    this? I tried inheriting MyPanel class with IContainer, still its not
    working. When I inherit the main control with Panel, I am able to add
    controls in design time while same I am doing for Inner Panel, its not
    working. Also I have tried adding InnerPanel (MyPanel) in Render, Init
    method, Constructor of controls, but neither way it worked. Can any
    body suggest where I am doing wrong.

    wishing you all in anticipation,

    warm regards,
    - hungrymind

    hungrymind@gmail.com Guest

  2. Similar Questions and Discussions

    1. Template control not displaying Container properties
      I am trying to create a templated control for asp.net 2.0 using the example found in the documentation, however when outputing <%# Container.Message...
    2. Building a control to container users html
      I want to be able to create a control that will wrap any html placed inside the control tag with some predefine html. For example is the...
    3. User Control - Accessing Properties from the Container Page
      Dear all, Please check my problem - Problem: I have created a User Control(UC1) for navigating between pages. There are 4 buttons on the user...
    4. ASP.NEt Custom Container control
      I am creating a tab control. I want to allow the user to drop controls on my tab control at design time the way one can drop controls onto a panel...
    5. Looking for simple container control
      The problem is that you want to nest this control inside of a table, in fact, in between rows of the table. For this, you would need to create your...
  3. #2

    Default Re: How to create server control of Container Type

    Use ITemplate and in the CreateChildControls


    ///Property
    public ITemplate PanelTemplate
    {
    get{return m_PanelTemplate;}
    set{m_PanelTemplate = value;}
    }

    ///createchildcotnrols

    m_PanelTemplate.InstantiateIn(panelToInstantiate);
    //add any additional controls to the template

    Gary Vidal
    <hungrymind@gmail.com> wrote in message
    news:1153394028.817097.83060@m79g2000cwm.googlegro ups.com...
    > Hi All,
    >
    > I am trying to build one server control which has one panel and within
    > this panel there will be two more panel. I have created two instance of
    > MyPanel class (inherited by Panel), it works fine in design as well as
    > runtime. The problem is I want user to be able to add controls on
    > designtime to the inner panel. Can any body tell me how to achieve
    > this? I tried inheriting MyPanel class with IContainer, still its not
    > working. When I inherit the main control with Panel, I am able to add
    > controls in design time while same I am doing for Inner Panel, its not
    > working. Also I have tried adding InnerPanel (MyPanel) in Render, Init
    > method, Constructor of controls, but neither way it worked. Can any
    > body suggest where I am doing wrong.
    >
    > wishing you all in anticipation,
    >
    > warm regards,
    > - hungrymind
    >

    Gary Vidal Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139