Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7411617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:24:48+00:00 2026-05-29T06:24:48+00:00

I want to create custom templated control which controls inside of template coluld be

  • 0

I want to create custom templated control which controls inside of template coluld be got in page (a behavior similar to updatepanel). So, issue in more details.
The control has to look like:

<ec:TabControl runat="server" ID="tab">
    <Tabs>
        <ec:Tab runat="server">
            <TabContainer>
                <asp:Button runat="server" Text="aaaaaa" />
            </TabContainer>
            <TabName>
                text or controls
            </TabName>
        </ec:Tab>
        <ec:Tab runat="server">
            <TabContainer>
                <asp:Button runat="server" Text="vcxvxvxv" />
            </TabContainer>
            <TabName>
                some text
            </TabName>
        </ec:Tab>
    </Tabs>
</ec:TabControl>

It works well in way as databound control operates. In other words, during ondatabound stage all controls inside and templates are instanated appropriately.
But what i do want is to have access to controls inside and directly from page (by ID). For example, you can do it using updatepanel (content of is avaiable within page scope).

Below you can see fragment of control’s source code:

public class Tab
{
    [PersistenceMode(PersistenceMode.InnerProperty)]
    [TemplateContainer(typeof(HtmlAnchorContainer))]
    [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
    public ITemplate TabName { get; set; }

    [PersistenceMode(PersistenceMode.InnerProperty)]
    [TemplateContainer(typeof(PanelContainer))]
    [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
    public ITemplate TabContainer { get; set; }
}

public class TabControl : System.Web.UI.WebControls.WebControl
{
    List<Tab> tabs;
    [DesignerSerializationVisibility(DesignerSerializationVisibility.Content),
    PersistenceMode(PersistenceMode.InnerProperty),
    NotifyParentProperty(true)]
    public List<Tab> Tabs
    {
        get { return tabs ?? new List<Tab>(); }
        set { tabs = value; }
    }

    protected override void CreateChildControls()
    {
        base.CreateChildControls();
        .....
        foreach (Tab tabItem in Tabs)
        {
            //generating tree control for further rendering
        }
        ...
    }

    protected override void OnDataBinding(EventArgs e)
    {
        EnsureChildControls();
        base.OnDataBinding(e);
    }
 }

Hope for you advices, recommendations, links and constructive criticism.))

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T06:24:50+00:00Added an answer on May 29, 2026 at 6:24 am

    Apply a:

    [TemplateInstance(TemplateInstance.Single)]
    

    declaration to your templates where you want to reference the control directly, then this should be resolved.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need a help about creating custom wpf controls.I want to create a template
I want to create a custom template engine like velocity or freemarker which will
I want to create a custom control (partial view, template) and have it function
I want to create a custom control in C#. But every time I have
I want to know if i can create a custom google maps application,on which
I want to create a custom control that extends a built-in control and then
I want a create a custom/user control that has children. For Example, I want
I want to create a Custom Control derived from ComboBox , however if I
I want to create new SPWebs with a Custom Template. $web = New-SPWeb $Url
I'm using Custom Post Template which I linked to Magic Fields to create custom

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.