Sunday, 31 October 2010

Ajax CollapsiblePanelExtender - How to use different control for expand and collapse


Ajax CollapsiblePanelExtender - How to use different control for expand and collapse




CollapsiblePanelExtenderExpandCollapse.aspx




<%@ Page Language="C#" AutoEventWireup="true" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">

</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Ajax CollapsiblePanelExtender - How to use different control for expand and collapse</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<h2 style="color:MidnightBlue; font-style:italic;">
Ajax CollapsiblePanelExtender - How to use
<br /> different control for expand and collapse
</h2>
<hr width="500" align="left" color="DodgerBlue" />
<asp:ScriptManager
ID="ScriptManager1"
runat="server"
>
</asp:ScriptManager>
<cc1:CollapsiblePanelExtender
ID="CollapsiblePanelExtender1"
runat="server"
TargetControlID="Panel1"
ExpandControlID="Button1"
CollapseControlID="Button2"
TextLabelID="Label1"
ExpandedText="-"
CollapsedText="+"
Collapsed="true"
SuppressPostBack="true"
>
</cc1:CollapsiblePanelExtender>
<asp:Label
ID="Label1"
runat="server"
ForeColor="MediumVioletRed"
Font-Italic="false"
Font-Names="Comic Sans MS"
Font-Size="XX-Large"
>
</asp:Label>
<asp:Button
ID="Button1"
runat="server"
ForeColor="DodgerBlue"
Font-Bold="true"
Height="45"
Text="Expand"
/>
<asp:Button
ID="Button2"
runat="server"
ForeColor="DodgerBlue"
Font-Bold="true"
Height="45"
Text="Collapse"
/>
<br /><br />
<asp:Panel
ID="Panel1"
runat="server"
Width="450"
BorderColor="DarkBlue"
BorderWidth="2"
BackColor="Navy"
HorizontalAlign="Center"
>
<asp:Image
ID="Image2"
runat="server"
ImageUrl="~/Image/Hornet.jpg"
Height="325"
/>
</asp:Panel>
</div>
</form>
</body>
</html>
















No comments:

Post a Comment