Insert a control in user web control

Discussion in 'ASP .Net Web Controls' started by Eric, Jan 7, 2004.

  1. Eric

    Eric Guest

    I have createed a user web control that I want to act as a frame for
    other controls. The user web control is basically a table with a few
    rows and cells. I would like to be able to place other web controls
    within a specific cell defined in the uwc. My question is how can I
    do this within the aspx page in the following way?:

    <uc1:stdFrame id="mainFrame" runat="server">
    <dx1:OtherContro id="myControl"l></dx1:OtherControl>
    </uc1:stdFrame>

    then myControl would appear within the cell designated as the
    container.

    Thanks.
     
    Eric, Jan 7, 2004
    #1
    1. Advertising

  2. Hi Eric,

    By design UserControl are not meant to contain child controls specified
    declaratively. You can hack this by applying the ParseChildrenAttribute
    metadata attribute (setting it to false) to your UserControl-derived class.

    --
    Victor Garcia Aprea
    Microsoft MVP | ASP.NET
    Looking for insights on ASP.NET? Read my blog:
    http://obies.com/vga/blog.aspx


    "Eric" <> wrote in message
    news:...
    > I have createed a user web control that I want to act as a frame for
    > other controls. The user web control is basically a table with a few
    > rows and cells. I would like to be able to place other web controls
    > within a specific cell defined in the uwc. My question is how can I
    > do this within the aspx page in the following way?:
    >
    > <uc1:stdFrame id="mainFrame" runat="server">
    > <dx1:OtherContro id="myControl"l></dx1:OtherControl>
    > </uc1:stdFrame>
    >
    > then myControl would appear within the cell designated as the
    > container.
    >
    > Thanks.
     
    Victor Garcia Aprea [MVP], Jan 8, 2004
    #2
    1. Advertising

  3. Hi Eric,

    Thanks for posting in this group.
    Just as Victor said, you can refer to ParseChildrenAttribute class to get
    this done.
    For more information, please refer to:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
    frlrfsystemwebuiparsechildrenattributeclasstopic.asp
    Also, there are samples at the links below:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
    l/cpconparsechildrenattributesample.asp
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
    l/cpconusingparsechildrenattribute.asp

    You also may refer to ControlBuilderAttribute which enables more complex
    parsing logic by associating a control builder class with the control.
    Please refer to:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
    frlrfSystemWebUIControlBuilderAttributeClassTopic.asp

    Hope this helps,

    Best regards,
    Jeffrey Tan
    Microsoft Online Partner Support
    Get Secure! - www.microsoft.com/security
    This posting is provided "as is" with no warranties and confers no rights.
     
    Jeffrey Tan[MSFT], Jan 8, 2004
    #3
    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. Reny J Joseph Thuthikattu
    Replies:
    1
    Views:
    576
    =?Utf-8?B?UHJha2FzaC5ORVQ=?=
    Dec 30, 2004
  2. ABC
    Replies:
    1
    Views:
    2,658
    Larry
    Oct 4, 2005
  3. ABC
    Replies:
    0
    Views:
    491
  4. ABC
    Replies:
    0
    Views:
    215
  5. Feege
    Replies:
    0
    Views:
    485
    Feege
    Dec 20, 2005
Loading...

Share This Page