This control is relatively simple. It has been available since Microsoft released the Ajax predecessor Atlas, and its functional applications are also quite common. This example has already been implemented, now I am not busy with my work and send it to new users for reference and learning. Code :
<% @ Page Language = " C # " Autoeventwireup = " True " Codebehind = " Collapsiblepaneldeml. aspx. CS " Inherits = " Apptestajax. collapsiblepaneldeml " %>
<% @ Register assembly = " Ajaxcontroltoolkit " Namespace = " Ajaxcontroltoolkit " Tagprefix = " PC3 " %>
<! Doctype HTML public " -// W3C // dtd xhtml 1.0 transitional // en " " Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd " >
< HTML xmlns = " Http://www.w3.org/1999/xhtml " >
< Head runat = " Server " >
< Title > Untitled page </ Title >
</ Head >
< Body style = " Text-align: Center " >
< Form ID = " Form1 " Runat = " Server " >
< Div Style = " Text-align: left " >
Panel Display and hiding Functions < BR />
< ASP: scriptmanager ID = " Scriptmanager1 " Runat = " Server " >
</ ASP: scriptmanager >
< C0: collapsiblepanelextender ID = " Collapsiblepanelextender1 "
Collapsecontrolid = " Image1 "
Expandcontrolid = " Image1 "
Collapsed = " True "
Textlabelid = " Label1 "
Imagecontrolid = " Image1 "
Expandedimage = " Image/collapse.jpg "
Collapsedimage = " Image/expand.jpg "
Suppresspostback = " True "
Targetcontrolid = " Panel2 "
Expandedtext = " (Hide details) "
Collapsedtext = " (Show Details) "
Runat = " Server " >
</ C0: collapsiblepanelextender >
< ASP: Panel ID = " Panel1 " Runat = " Server " Height = " 1px " Width = " 561px " Backcolor = " Control " >
< Table Style = " Height: 30px " >
< Tr >
< TD Style = " Width: 100px; Height: 26px; " >
</ TD >
< TD Style = " Width: 331px; Height: 26px; " >
< ASP: Label ID = " Label1 " Runat = " Server " > (Show Details) </ ASP: Label > </ TD >
< TD Style = " Width: 100px; Height: 26px; " >
< A href = " # " > < ASP: Image ID = " Image1 " Runat = " Server " Imageurl = " ~ /Image/collapse.jpg " Alternatetext = " (Show Details) " /> </ A > </ TD >
</ Tr >
</ Table >
</ ASP: Panel >
& Nbsp;
< BR />
< ASP: Panel ID = " Panel2 " Runat = " Server " Height = " 310px " Width = " 571px " >
< ASP: Image ID = " Image2 " Runat = " Server " Height = " 301px " Imageurl = " ~ /Image/img_1629.jpg "
Width = " 548px " /> </ ASP: Panel >
< BR />
< ASP: Image ID = " Image3 " Runat = " Server " Height = " 393px " Imageurl = " ~ /Image/img_1629.jpg "
Width = " 566px " />
</ Div >
< BR />
</ Form >
</ Body >
</ Html >
It's relatively simple, so I don't need to explain anything. Haha, let's discuss it if you have any questions ....... together, I made some contributions to China's software ......