12th: 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, only added to the source code. Code ) Code
< Body >
< Form ID = " Form1 " Runat = " Server " >
< Div >

< ASP: scriptmanager ID = " Scriptmanager1 " Runat = " Server " >
</ ASP: scriptmanager >
< BR />

< MAID: accordion ID = " Accordion1 " Runat = " Server " >
</ PC3: accordion >
< BR />
< BR />

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

4. In<MAID: accordion ID="Accordion1"Runat="Server"></PC3: accordion> Add <panes> </panes>

5.Drag several accordionpane in <panes> </panes> (several layers are required)

Code
< MAID: accordion ID = " Accordion1 " Runat = " Server " >
< Panes >
< C0: accordionpane ID = " Accordionpane1 " Runat = " Server " >
</ C0: accordionpane >
< C0: accordionpane ID = " Accordionpane2 " Runat = " Server " >
</ C0: accordionpane >
< C0: accordionpane ID = " Accordionpane3 " Runat = " Server " >
</ C0: accordionpane >
</ Panes >
</ PC3: accordion >

6. Add code to accordionpanel: Code
< MAID: accordion ID = " Accordion1 " Runat = " Server " >
< Panes >
< C0: accordionpane ID = " Accordionpane1 " Runat = " Server " >
< Header > Here is Title 1 </ Header >
< Content > Here is the content of heading 1. </ Content >
</ C0: accordionpane >
< C0: accordionpane ID = " Accordionpane2 " Runat = " Server " >
< Header > Here is Title 2 </ Header >
< 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 >
</ C0: accordionpane >
< C0: accordionpane ID = " Accordionpane3 " Runat = " Server " >
< Header > Here is Title 3 </ Header >
< Content > Here is the content of heading 3. </ Content >
</ C0: 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 !!!


Related Article

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.