Insert a control in user web control

E

Eric

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.
 
V

Victor Garcia Aprea [MVP]

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.
 
J

Jeffrey Tan[MSFT]

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top