ITemplate and inbedded controls
- From: "Perecli Manole" <Perecli@xxxxxxxxxxxxxx>
- Date: Mon, 18 Dec 2006 15:00:47 -0800
I created a tabstrip custom control that is declared like this:
<acc:TabStrip ID="Tabs" runat="server" SelectedTabID="aa"
AutoPostBack="true">
<Tab ID="aa" Text="aa">
<Template/>
</Tab>
<Tab ID="bb" Text="bb"/>
<Template>
<asp:Panel ID="test" ..... or any other control />
</Template>
</Tab>
</acc:TabStrip>
I am using <ControlBuilder(GetType(TabStrip.ControlBuilder)),
ParseChildren(False)> attributes on the TabStrip Class and overrided
AddParsedSubObject() to add the Tabs to a collection of type
StateManagedCollection. Then somewhere in PreRender as I am iterating
through the collection I am doing this
"objTab.Template.InstantiateIn(objTableCell)" to place the contents of the
template in a TableCell that is being rendered by the TabStrip control.
Everything renderes and operates properly, however, as a control consumer, I
have not found a way to access any of the controls contained in the
template. In the example above I can not access the control with ID="test"
in the code behind so if I wanted to change any properties of these
controls, on post back, I could not. How should I change my implementation
to allow my consumers to access the controls contained in the <Template>
tags.
Perry
.
- Prev by Date: RE: HELP: (ASP.NET 2.0) - Can't get CSS HtmlLink Element working in VS Designer
- Next by Date: Embeding html controls in Server Control
- Previous by thread: LazyHttp, or the HTTP protocol dissected...
- Next by thread: Embeding html controls in Server Control
- Index(es):
Relevant Pages
|