Introduction to ASP.net Ajaxcontroltoolkit--tabcontainer controls-practical tips

Source: Internet
Author: User

Introduction Collection for Ajaxcontroltoolkit--tabcontainer controls

1. Introduction:
The tab itself should be a control that displays the contents of an organization's web page in a page-signing format. There is a Tabcontainer control in the AJAX Control Tool Kit, which is the carrier of some tabpanel controls, and each tabpanel can be a container for some other asp.net controls like a standard panel control. TABPANEL specifies its contents through its three-part structure HeaderText, HeaderTemplate, and ContentTemplate properties.
The Tabcontainer control has the ability to maintain the current page state. When a page is refreshed, the most recently selected tab is kept in its selected state, and the operable property pages for each tab can be persisted.
2. Properties:
<ajaxtoolkit:tabcontainer runat= "Server" onclientactivetabchanged= "clientfunction" height= "150px" > < Ajaxtoolkit:tabpanel runat= "Server" headertext= "Signature and Bio" <ContentTemplate> ... </contenttemplate >/></ajaxtoolkit:tabcontainer> above is the structure of Tabcontainer, which is divided into two parts, Tabcontainer properties and TabPanel attributes.
Tabcontainer Properties:
A. Activetabchanged (event): The event that is triggered when the tab in the election is changed (server-side events).
B. Onclientactivetabchanged: The client script event that is triggered when the tab change is selected.
C. CssClass-a CSS Class style that is used to define its customer performance, has a default Tab theme style, but can also be modified to suit actual needs
D. Activetabindex-initialization is set to the selected Tab
E. Height-the height of the Tab (excluding its title bar)
F. Width-the width of the Tab
G. ScrollBars-Display scroll bars, can be set to, None, horizontal, Vertical, Both, or Auto
TabPanel Properties:
A. Enabled-whether the Tab page is displayed, which can be changed in client script
B. OnClientClick-The name of the client script event that is triggered when clicked
C. Headertext-tab Title
D. HeaderTemplate-a templateinstance.single itemplate used for its definition of headings
E. ContentTemplate-a templateinstance.single itemplate used for its definition of content
The special note is that CssClass can be set for your custom format CSS, if your cssclass for customer, you need to customize the CSS attributes have the following:
Tabs CSS Classes
Copy Code code as follows:

.ajax__tab_header:a container element that wraps all of the tabs in the top of the Tabcontainer. Child CSS Classes:.ajax__tab_outer.
.ajax__tab_outer:an outer element of a tab, often used to set the left-side image of the tab. Child CSS classes:. Ajax__tab_inner.
.ajax__tab_inner:an inner element of a tab, often used to set the right-side image of the tab. Child CSS Classes:.ajax_ _tab_tab.
.ajax__tab_tab:an element of the tab that contains the text content. Child CSS Classes:none.
.ajax__tab_body:a container element that wraps the area where A TabPanel is displayed. Child CSS Classes:none.
.ajax__tab_hover. This is applied to a tab then the mouse is hovering over. Child CSS Classes:.ajax__tab_outer.
.ajax__tab_active:this is applied to a tab as it is the currently selected tab. Child CSS Classes:.ajax__tab_outer.

Then the custom header CSS is called; customer.ajax_tab_header{.} /
Several custom CSS styles are described in the following example.
3. Example:
As with every previous control, we need to first create a ajaxtoolkit template:
First step: Create a Ajaxtoolkit Template:

A project name is called Ajaxcontroltoolkit_tab.

Step two: Edit the Default.aspx page,

You first need to drag a Tabcontainer control under the ScriptManager of the form, and then set its properties:

You can see that each tabcontainer need to have TabPanel panel in the properties of the set HeaderText, which is the name of the tab, and then each panel needs to ContentTemplate to display the content, casually fill in the point displayed.


Then add a few more tabpanel, and the contents of each of the following TabPanel can be copied here.
Because I set the CssClass property here, the control overloads the CSS instead of the default CSS style.
Step three: We need to create a CSS file to store the custom tab style.
Right-click Project, tap ' Add New Item ', create a file called Stylee.css, and then add the <Head> node section of the Default.aspx file
<link rel= "stylesheet" type= "Text/css" href= "Stylesheet.css"/>
Here are the CSS styles used:
/* Ajax__tab_ie-theme Theme * *
. Ajax__tab_ie-theme. Ajax__tab_header
{
padding-left:5px;
}
. ajax__tab_ie-theme. Ajax__tab_header. Ajax__tab_tab
{
margin-right:0px;
Background:url (img/ie/tab_unselected.gif);
width:116px;
padding:9px 0px 3px 0px;
Text-align:center;
Color: #006699;
Font-family:verdana;
font-size:13px;
Display:block;
}
. ajax__tab_ie-theme. ajax__tab_active. Ajax__tab_tab
{
padding:6px 0px 3px 0px;
Background:url (img/ie/tab_selected.gif);
}
. Ajax__tab_ie-theme. Ajax__tab_body
{
Background:url (img/ie/ie_tabbacker_720x296.jpg) no-repeat;
font-size:13px;
Font-family:verdana;
height:296px;
width:716px;
}
. ajax__tab_ie-theme. Ajax__tab_body Div
{
padding:8px;
}
The fourth step: Add the picture to the project day: Create an IMG folder, then add the picture, the use of the picture in the following provided by the Code link can be downloaded.
4. Code Download:
Package download

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.