I have a user control which accepts a title attribute. I would also like that input inner HTML (ASP Controls also) inside of that user control tag like so:
<uc:customPanel title="My panel">
<h1>Here we can add whatever HTML or ASP controls we would like.</h1>
<asp:TextBox></asp:TextBox>
</uc:customPanel>
How can I achieve this? I have the title attribute working correctly.
Thanks.
Best Solution
Implement a class that extends Panel and implements INamingContainer:
Then, your CustomPanel needs to expose a property of type Container and another property of type ITemplate:
Then in method
CreateChildControls()
, add this:And you will be using it like this: