Click here to Skip to main content
15,920,896 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi..

i have multiple collapsible panel extenders in single page

what i want is when one panel is expanded others if open become close .
Using c#.
Posted
Comments
Ralf Meier 8-Jun-15 1:45am    
OK ... you desribed what is nescessary to be done.
Where is actually the problem and what have you done until now ?
Member 11686116 8-Jun-15 2:25am    
<form id="form1" runat="server">
<asp:ToolkitScriptManager ID="ScriptManager1" runat="server">

<div>
<asp:Panel ID="pnlClick" runat="server" CssClass="pnlCSS" Height="18%"
Width="50%" >
<div style="background-image:url('070_minus.png'); height:30px; vertical-align:middle">
<div style="float:left; color:White;padding:5px 5px 0 0">
<asp:Label ID="lbl1" runat="server" Text="CollasiblePanel" Width="40%">
</div>
<div style="float:right; color:White; padding:5px 5px 0 0">
<asp:Label ID="lblMessage" runat="server" Text="Label"/>
<asp:Image ID="imgArrows" runat="server" ImageUrl="~/Image/plus.png" Width="23px" />
</div>
<div style="clear:both"></div>
</div>

<asp:Panel ID="pnlCollapsable" runat="server" Height="0" CssClass="pnlCSS">
<table align="center" width="100%">
<tr>
<td></td>
<td>
Registration Form
</td>
</tr>
<tr>
<td align="right" >
UserName:
</td>
<td>
<asp:TextBox ID="txtuser" runat="server"/>
</td>
</tr>
<tr>
<td align="right" >
Password:
</td>
<td>
<asp:TextBox ID="txtpwd" runat="server"/>
</td>
</tr>
<tr>
<td align="right">
FirstName:
</td>
<td>
<asp:TextBox ID="txtfname" runat="server"/>
</td>
</tr>
<tr>
<td align="right">
LastName:
</td>
<td>
<asp:TextBox ID="txtlname" runat="server"/>
</td>
</tr>
<tr>
<td align="right">
Email:
</td>
<td>
<asp:TextBox ID="txtEmail" runat="server"/>
</td>
</tr>
<tr>
<td align="right" >
Phone No:
</td>
<td>
<asp:TextBox ID="txtphone" runat="server"/>
</td>
</tr>
<tr>
<td align="right" >
Location:
</td>
<td align="left">
<asp:TextBox ID="txtlocation" runat="server"/>
</td>
</tr>
<tr>
<td></td>
<td align="left" >
<asp:Button ID="btnsubmit" runat="server" Text="Save"/>
<input type="reset" value="Reset" />
</td>
</tr>
</table>

<asp:CollapsiblePanelExtender
ID="CollapsiblePanelExtender1"
runat="server"
CollapseControlID="pnlClick"
Collapsed="true"
ExpandControlID="pnlClick"
TextLabelID="lbl1"
CollapsedText="Show"
ExpandedText="Hide"
ImageControlID="imgArrows"
CollapsedImage="../Image/plus.png"
ExpandedImage="../Image/070_minus.png"
ExpandDirection="Vertical"
TargetControlID="pnlCollapsable"
ScrollContents="false">

</div>

<div>
<asp:Panel ID="Panel1" runat="server" CssClass="pnlCSS" Height="18%"
Width="50%">
<div style="background-image:url('070_minus.png'); height:30px; vertical-align:middle">
<div style="float:left; color:White;padding:5px 5px 0 0">
<asp:Label ID="Label1" runat="server" Text="CollasiblePanel">
</div>
<div style="float:right; color:White; padding:5px 5px 0 0">
<asp:Label ID="Label2" runat="server" Text="Label"/>
<asp:Image ID="Image1" runat="server" ImageUrl="~/Image/plus.png" Width="23px" />
</div>
<div style="clear:both"></div>
</div>

<asp:Panel ID="Panel2" runat="server" Height="0" CssClass="pnlCSS">
<table align="center" width="100%">
<tr>
<td></td>
<td>
Registration Form
</td>
</tr>
<tr>
<td align="right" >
UserName:
</td>
<td>
<asp:TextBox ID="TextBox1" runat="server"/>
</td>
</tr>
<tr>
<td align="right" >
Password:
</td>
<td>
<asp:TextBox ID="TextBox2" runat="server"/>
</td>
</tr>
<tr>
<td align="right">
FirstName:
</td>
<td>
<asp:TextBox ID="TextBox3" runat="server"/>
</td>
</tr>
<tr>
<td align="right">
LastName:
</td>
<td>
<asp:TextBox ID="TextBox4" runat="server"/>
Member 11686116 8-Jun-15 2:28am    
So here i want to Expand one Collapsible Panel then other Should Collapse using c# r JavaScript...
Help meeeee
Member 11686116 8-Jun-15 2:40am    
here i should not use Accordion.
Member 11686116 8-Jun-15 2:40am    
:(

1 solution

Use Jquery accordion for expand and collapse of panels in clients side.
If you want to do this in c# multiple post backs happens which ll affect the response time.

Click here [^]
 
Share this answer
 
Comments
Member 11686116 8-Jun-15 2:41am    
but here i have to use only Collapsible panel

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900