Use collapsiblepanelextender to expand and contract

Source: Internet
Author: User

Generally, JS is used to expand and contract the webpage.CodeIt is troublesome to implement. Now there is a way to achieve brilliant expansion and contraction without writing a JS Code. That is, the collapsiblepanelextender control is used. The space belongs to Microsoft's atlas,

Http://atlas.asp.net/default.aspx? Tabid = 47 & subtabid = 471

First, you must add at least two panels on the page. The first panel is used to hold the title, and the second panel is used to hold the content. When you click the first panel, you can control the expansion and contraction of the first panel. The most basic code is as follows:

<PC3: collapsiblepanelextender id = "collapsiblepanelextender1"
Runat = "server">
<PC3: collapsiblepanelproperties

Collapsecontrolid = "Panel1"

Expandcontrolid = "Panel1"
Targetcontrolid = "panel2"/>

</PC3: collapsiblepanelextender>

The targetcontrolid attribute refers to the controlled panel, which is panel2.

The expandcontrolid attribute refers to the control expanded panel, which is Panel1, that is, panel2 is displayed when you click Panel1.

The attribute collapsecontrolid refers to the Panel that controls contraction. Here is panel1.

These three are the most basic and commonly used attributes, and there are many other attributes. flexible use of these attributes can implement many dazzling functions. Next we will briefly introduce other attributes.

Targetcontrolid: The controlled panel.

Collapsedsize: size of the target after contraction

Expandedsize: Size of the expanded target

Collapsed: expand when true or contract when false

Scroll contents: When the value is true and the size of the target panel is smaller than the size of the content, the scroll bar is automatically added.

Expandcontrolid/collapsecontrolid: Click these controls to expand or contract the target panel.

Textlabelid: indicates the ID of a label control. The value of this label changes according to the status of the target panel.

Collapsedtext: Set the lable value indicated by textlabelid when the target panel is scaled down.

Expandedtext: Set the lable value indicated by textlabelid when the target panel is expanded.

Imagecontrolid: indicates an image control. The control changes the Image Based on the status of the target panel.

Collapsedimage: indicates the path of the image indicated by imagecontrolid when the target panel is scaled.

Expandedimage: indicates the path of the image indicated by imagecontrolid when the target panel is expanded.

Expanddirection: indicates the direction of horizontal or vertical expansion and contraction of the target panel.

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.