ITemplate and inbedded controls



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


.



Relevant Pages

  • RE: Id guess I cant do this
    ... Templated User Control. ... Creating the Template Class ... When you have a dynamic template available, you can instantiate it in code. ... Add a data-binding event handler to the controls you create in the template. ...
    (microsoft.public.dotnet.languages.vb)
  • RE: Resolving datasource expression
    ... | a custom ASP.NET template databound control and the control will display ... | DataItem is just a propety of the "Container", ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: Listing objects
    ... App will be the root, ... asks a Control to do that. ... a page has a template ... So, after Controller instantiates Data, it should check that the loaded ID wasn't already assigned in some other Controller. ...
    (comp.lang.php)
  • Re: 840807 - DLGITEMTEMPLATE
    ... Making it part of the template just sounds like taking a simple ... So, given a problem statement, how to associate data with a control, there is at least one ... >"how can i access the creation data i delivered for a control along ... >u ask "Why do you need a global function to be called?" ...
    (microsoft.public.vc.mfc)
  • RE: Resolving datasource expression
    ... a custom ASP.NET template databound control and the control will display ... different template and you're wondering how to retrieve the template type ... Based on my understanding on custom template databound control, ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)