-->

Thursday, May 9, 2013

How to use CollapsiblePanelExtender in AJAX

How to use CollapsiblePanelExtender in AJAX

CollapsiblePanelExtender enables you to hide and show the contents on a page alternatively, this extender builds up a collapsible section in your web page.

lets take an Example

Copy this code and paste your web form ( Before copy you must add ajax control tool kit to your project )


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

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

<!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></title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
    <asp:LinkButton ID="LinkButton1" runat="server">expand it</asp:LinkButton>
    <asp:Panel ID="Panel1" runat="server" BackColor="#FF3300" ForeColor="White">
        <br />
        <br />
    </asp:Panel>
    <asp:CollapsiblePanelExtender ID="CollapsiblePanelExtender1" runat="server"
        CollapseControlID="LinkButton1" CollapsedText="please expand it"
        ExpandControlID="LinkButton1" ExpandedText="please collapse it"
        SuppressPostBack="True" TargetControlID="Panel1" Collapsed="True"
        CollapsedSize="0" ExpandedSize="250" TextLabelID="Label1">
    </asp:CollapsiblePanelExtender>
    <div>

    </div>
    </form>
</body>
</html>

OutPut



Read other related articles

Also read other articles

© Copyright 2013 Computer Programming | All Right Reserved