TabContainer dynamically adds TabPanel, TabPanel dynamically adds HeaderTemplate, ContentTemplate

Source: Internet
Author: User

Test Environment VS2005

Tabiner iner control of AjaxControlToolkit, which must be placed on the html of the page

<AjaxAsp: ScriptManager ID = "ScriptManager1" runat = "server">
</AjaxAsp: ScriptManager>

The background code is:

AjaxControlToolkit. TabPanel ta = new AjaxControlToolkit. TabPanel ();
Ta. HeaderText = "hello ";
Ta. ID = "1 ";
Ta. TabIndex = 0;
Label lb = new Label ();
Lb. Text = "your specific content ";
Ta. Controls. Add (lb );

AjaxControlToolkit. TabPanel tb = new AjaxControlToolkit. TabPanel ();
Tb. HeaderText = "hello ";
Tb. ID = "2 ";
Tb. TabIndex = 1;
Label lb1 = new Label ();
Lb1.Text = "what are you doing ";
Tb. Controls. Add (lb1 );

AjaxControlToolkit. TabContainer tab = new AjaxControlToolkit. TabContainer ();
Tab. Tabs. Add (ta );
Tab. Tabs. Add (tb );
This. pn. Controls. Add (tab );

 

Pn a Panel control adds TabContainner to the panel control, and dynamically adds TabContainer and TabPanel to the Panel.

The ContentTemplate of TabPanel is a content template. You can dynamically add controls to display specific content.

Read data from the database and display it on the TabPanel. Just like in the above example, you can change the data ......

The effect is as follows. I personally tested it.

 

Write by: suhanyu Date: 2008-11-18

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.