11th: Ajax Control Toolkit control package-1. Accordion (multilayer folding effect)

Source: Internet
Author: User

1. Create a web form: accordion. aspx
2. Add a scriptmanager Control
3. Add an accordion control. (Note: When you drag the accordion control to the form, the form is displayed as anything. Add code to the source code only)

Code
<Body>
<Form ID = "form1" runat = "server">
<Div>

<Asp: scriptmanager id = "scriptmanager1" runat = "server">
</ASP: scriptmanager>
<Br/>

<PC3: accordion id = "accordion1" runat = "server">
</PC3: accordion>
<Br/>
<Br/>

</Div>
</Form>
</Body>

4. Add <panes> </panes>

5. Drag several accordionpane in <panes> </panes> (you need to drag several layers)

Code
<PC3: accordion id = "accordion1" runat = "server">
<Panes>
<PC3: accordionpane id = "accordionpane1" runat = "server">
</PC3: accordionpane>
<PC3: accordionpane id = "accordionpane2" runat = "server">
</PC3: accordionpane>
<PC3: accordionpane id = "accordionpane3" runat = "server">
</PC3: accordionpane>
</Panes>
</PC3: accordion>

6. Add code to accordionpanel:

Code
<PC3: accordion id = "accordion1" runat = "server">
<Panes>
<PC3: accordionpane id = "accordionpane1" runat = "server">
<Header> Title 1 <Content> here is the content of Title 1 </content>
</PC3: accordionpane>
<PC3: accordionpane id = "accordionpane2" runat = "server">
<Header> here is Title 2 <Content>
Here is the content of Heading 2.
<Asp: textbox id = "textbox1" runat = "server"> </ASP: textbox>
<Asp: button id = "button1" runat = "server" text = "button"/>
</Content>
</PC3: accordionpane>
<PC3: accordionpane id = "accordionpane3" runat = "server">
<Header> Title 3 <Content> here is the content of Title 3 </content>
</PC3: accordionpane>
</Panes>
</PC3: accordion>

7. OK, run, it can be used, but there is no border or colors.

8. Now you have to add the border color to the title.
① Open the accordion1 attribute panel and set the size, height (300px), width (200px)
② Set the title style, headercssclass (accordionheader)
③ Set the content style, contentcssclass (accordioncontant)

8. Create a style.

Code
<Style type = "text/CSS">
. Accordionheader
{
Color: # FFFF00;
Background-color: # 3399ff;
Border: 1px solid # ff6600;
Padding: 1px;
Margin: 1px;
Cursor: pointer;
}
. Accordioncontent
{
Background-color: # ff9933;
Padding: 1px;
Margin: 1px;
}
</Style>

9. OK. Try it !!!

10. Explanation of common attributes

1. Set the size, height (300px), width (200px)
2. Set the title style, headercssclass (accordionheader)
3. Set the content style, contentcssclass (accordioncontant)

4. Set fade-in, fadetransitions = "True/false"

5. Select the index, selectedindex = "0/1/2/3/4"

6. Automatic size (scroll bar) and autosize

7,Transitionduration: The time to expand or collapse An accordionpane, in milliseconds.

8,Framespersecond: Expand or collapse the number of frames per second of an accordionpane.

9,AccordionDisplay and layout.

AccordionThe following three display and layout modes are supported:

None-When accordion is expanded or folded, the size of accordion is automatically changed based on the content displayed inside the accordion, without any restrictions. Setting the autosize attribute to none may cause other elements on the page to move up or down following the size change of accordion.
Limit-It will make the accordion control never extend its size beyond the specified height attribute. If you set the autosize attribute to limit, it may cause a situation where, the content in it needs to be rolled through the scroll bar.
Fill-It will keep the accordion Control always at the height defined by its height attribute.

10,Requireopenedpane: If it is set to true, if an accordionpane is expanded, it will no longer be folded.

11,Supporessheaderpostbakcs: If this parameter is set to true, the page will be submitted when you click a pane, that is, whether to display the whole page refresh.

12,Headertemplate/contenttemplate, datasource, performanceid, datamember. These are all used for data binding. This article will not involve.

 

 

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.