C# .NET - How to add an OnClick Event for panel which in turn expand my AjaxCollapsable panel

Asked By Harish Mady on 28-Jun-12 07:26 AM
Hi All,

How to add an OnClick Event for panel which in turn expand my AjaxCollapsable panel and Bind my Gridview
Please help me out from this

Thanks
Lalit M replied to Harish Mady on 28-Jun-12 07:37 AM
Check this link will guide
---------------
http://r4r.co.in/asp.net/01/tutorial/asp.net_ajax/ajax-toolkit-extender-control/CollapsiblePanel.shtml
http://forums.asp.net/t/1137354.aspx
dipa ahuja replied to Harish Mady on 28-Jun-12 07:39 AM
A simple example :

<cc1:CollapsiblePanelExtender ID="CollapsiblePanelExtender2" runat="server" CollapseControlID="lbl2"
  ExpandControlID="lbl2" TargetControlID="Panel2" Collapsed="true">
</cc1:CollapsiblePanelExtender>
<asp:Label ID="lbl2" runat="server" Text="click" />
<asp:Panel ID="Panel2" runat="server" Width="300" BackColor="Gray">
  <asp:Panel ID="Panel3" BorderStyle="Solid" Width="300" BackColor="WhiteSmoke" runat="server"
    CssClass="ModalWindow">
    User name:
    <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox><br />
    Password :
    <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
  </asp:Panel>
</asp:Panel>
 
Jitendra Faye replied to Harish Mady on 29-Jun-12 12:57 AM

you can use jquery Accordian control also, because it is client side so it will take less time.


After adding jquery ui plugin you can use jquery Accordian like this-


<script>
$(function() {
$( "#accordion" ).accordion();
});
</script>

<div id="accordion">

<h3><a href="#">Section 1</a></h3>
<div>
</div>

<h3><a href="#">Section 2</a></h3>
<div>
</div>

<h3><a href="#">Section 3</a></h3>
<div>

</div>

</div>

For more help follow this link-

http://jqueryui.com/demos/accordion/

Here you will get example.