.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links


Posted By:      Posted Date: August 30, 2010    Points: 0   Category :ASP.Net
Hiii Coders, I have four collapsiblepanelextendrs on my page. Now i want that whenever, i click on one extender to expand others panels in expanded state should be collapsed at same time. How can i achieve this in C#   PLZ REP AS SOON AS POSS THANX AND REGARDS

View Complete Post

More Related Resource Links

How to make expanding/collapsing CollapsiblePanelExtender from code behind smooth and animated


I've got a CollapsiblePanelExtender in place on a panel in test and it works like a champ. (I get excited about the simplest things).  When I click the panel header it expands and collapses with smooth animation, as expected and desired.

But when I change its state via code behind, it seems I am merely changing its state and somehow bypassing the javascript that controls the smooth animation.

My markup is out of the box. I have added code behind and some javascript, but I am missing the connection.  Here is the javascript:

function pageLoad(sender, args)

function smoothAnimation()
    var collPanel = $find("CollapsiblePanelExtender1");
    collPanel._animation._fps = 45;
    collPanel._animation._duration = 0.50;


And here is the code behind:

protected void btnExpand_Click(object sender, EventArgs e)
    this.CollapsiblePanelExtender1.Collapsed = false;
    this.CollapsiblePanelExtender1.ClientState = "false";

protected void btnCollapse_Click(object sender, EventArgs e)
    this.CollapsiblePanelExtender1.Collapsed = true;

Keep "collapsed" state of CollapsiblePanelExtender between postbacks



I have created a UserControl with a CollapsiblePanelExtender inside. In my Web page, I have a PlaceHolder in which many UserControls are added dynamically at every PostBack.

Everytime my page reloads, the CollapsiblePanelExtenders are expanded, even if they were collapsed before the PostBack. Is there a way to keep track of the "collapsed" state of the CollapsiblePanelExtender ? It seems hard since there is no server event triggered when the panel is collapsed / expanded.

Someone seemed to have the same problem here : http://forums.asp.net/p/1094970/1650425.aspx. I tried his solution (accessing the ClientState of the CollapsiblePanelExtenders using Request.Form) but my values are always null or true, even if the CollapsiblePanel is collapsed before PostBack.

Here is some piece of code :

AUMBlock block = (AUMBlock)Page.LoadControl("AUMBlock.ascx");
//CollapsiblePanelExtender cpe = (CollapsiblePanelExtender)block.FindControl("cpe");
//string clientState = cpe.ClientState;

collapsiblepanelextender Collapsed="true"

I have a drop down list, that when a value is selected a collapsible panel extender opens. If the drop down value is not selected, the collapsible panel extender closes.My drop down list and collapsible panel extender are inside an InsertItemTemplate of a FormView. I use javascript to open and close the collapsible panel extender.However, when I set the Collapsed="true" to the collapsible panel extender (as I want the collapsible panel extender closed when the InsertItemTemplate of the FormView opens), the Collapsed="true" appears to override the ability of the collapsible panel extender to open or close. Hence, the collapsible panel extender does not open. I have tried setting the Collapsed="true" server side and client side, but I cannot get the javascript to work when I try to use the Collapsed="true". I have also attempted using the BehaviourID of the collapsible panel extender, but to no avail.Can any one help me to get this working?Here is my code (cut down): My Panel & Collapsible Panel Extender Controls:<asp:Panel ID="PanelAchievementOwnHeadingInsertItem" CssClass="noFlickering" runat="server"> ........... </asp:Panel> <cc1:CollapsiblePanelExtender ID="CollapsiblePanelExtenderAchievementOwnHeadingInsert" Collapsed="true" CollapsedSize="0"

collapsiblepanelextender, master page and javascript

does anyone have any working code that uses javascript to open and close a cpe when the CPE is in a masterpage?  It seems like the javascript never is able to find the CPE when it is on a master page.  I have an DropDownList on the page and when certain items are selected, i want to collapse or expand when others are selected.  It seems to work fine on a regular page, but not when it is a page nested in a master page.  It is adding a suffix to the CPE and javascript is unable to find it.  any help would be much appreciated!<script type="text/javascript" language="javascript">        function ExpandCollapse() {            var e = document.getElementById("<%=DropDownList.ClientID%>")            var strUser = e.options[e.selectedIndex].value;            var collPanel = document.getElementById("<%=CPE.ClientID%>")            if (collPanel = null)                alert('No panel found');            if (strUser = "Collapse")    

collapsiblepanelextender problem with firefox

Hiiii Coders, I m trying to expand all the collpsible panels at the same time by clicking on expandall linkbutton and similarly i am trying to collapse all  collapsible panels by clicking on collapse all linkbutton. i have 4 collapsible panels. i have been using javascript code for that provided by sansan. It is working very much fine in Internet Explorer. But it does not work in Firefox. Here is my javascript code-<script type="text/javascript"> function TogglePanels(flag) { var panels = ["cpe1", "cpe2", "cpe3", "cpe4"]; for (var i = 0; i < panels.length; i++) if (flag) $find(panels[i])._doOpen(); else $find(panels[i])._doClose(); } </script> Here is my code for expandll and collapseall linkbuttons-<asp:LinkButton ID="L1" runat="server" Text="expand all" OnClientClick="TogglePanels(true);return false;"> </asp:LinkButton> <asp:LinkButton ID="L2" runat="server" Text="collapse all" OnClientClick="TogglePanels(false);return false;"> </asp:LinkButton> I don' know what is the problem plz provide code snippets as soon as poss as i m new to javascript. thanx and

Ajax CollapsiblePanelExtender /server side


Hello All,

         I am using Ajax:CollapsiblePanelExtender  and  when i click any button  it goes collapsed  .  Also during dropdown selected index changes it goes collapsed  . I want  it to be expanded.

        Any solutions will be appreciated.



programmatically expand/collapse the collapsiblepanelextender


using c#.net/asp.net 2005.

I have a collapsiblepanelextender that is working well when the user clicks on the "expand" and "collapse" buttons on the screen, however I would like to programmatically expand and collapse the collapsiblepanelextender in the c# code-behind.  Has anyone done this before?

I am typing the name of the collapsiblepanelextender in the code behind function and intellisense is not even showing that control as being a control that I can access from the aspx page so not certain why this is happening.

when I look in the aspx page the collapsiblepanelextender has a red squiqqly error line under it that says (when you mouse over it): "element 'collapsiblepanelextender' is not a known element. this can occur if there is a compilation error in the website"

but the panel works well when the user clicks it to expand and collapse and there are no compilation errors on the page, otherwise the page would not run, does this make sense?



CollapsiblePanelExtender Extending problem


I use two different collapsiblepanelExtenders with similar colapsedControlID which is not a matter here. Since both of them working but with some misbehaviour, for example if the first one is open and I click wherever on it , the second one extends. also by clicking on the second one it collapses.

That means that some how an event triggers and makes them collapse or extend.

I have a kind of editing panel inside each extandedPanel which are used to update something on the page. the problem is that by clicking on each textbox or fileupload, the second panel collapses again. before any other action. So that I can not enter the textboxes. I can do that if I use tab button on keyboard. but that sucks really.

<asp:Panel ID="OIOuterPanel" runat="server">

<asp:panel id="ExtPnl_orgInfo" runat="server" >


<asp:Panel id="ColPnl_orgInfo"  runat="server" >

<asp:panel id="OIOuterPanelExt" runat="server" >



                         <asp:CollapsiblePanelExtender ID="OICPEOuer" runat="server" TargetControlID="OIOuterPanelExt"

CollapsiblePanelExtender within custom server control


I am trying to use a collapsible panel extender within a custom server control.  I've used the extender elsewhere with no issues but when I try to add the control to  my panels collection of controls in my custom control, my page crashes.  Take it out and no error.  I'm adding other controls to the panel...literals, labels, etc.  This, however is the only ajax control I am using.  Is there something I need to do as far as registering the extender with the script manager (on the master page)?  Thanks....Brad

CollapsiblePanelExtender Onload when using Master/Content Pages



I'm wondering if anyone else has run into this problem; I have a collapsible panel extender to which I need to add some event handlers via javascript on page load: 


This was working perfectly...*until* I split the page into the Master/Content page scenario.  The control, the scriptmanager and the javascript are all declared in the content page right now. 

Suddenly, all my client side code comes up as the object being null or not found at the window.onload event.  After 3 days of chasing this dragon, I added a test button which calls the same functionality which should run onload and when clicked, it has no trouble at all finding the object *after* the page has fully loaded.  I've looked into almost all the posts on the web about this and I've found the question...but not the answer.  I've played with the recommended fixes dealing with BehaviorID...the ClientID...the ctl100_control_object and ctl100$control$object names and I'm still dead in the water.

Somehow, I have to get this code to run at the page onLoad event.  I'm gratefull for any suggestions at this point!

Thanks in advance!

have collapsiblePanelExtender event call databind


using vb.net/asp.net 2005

I have an outerGridview and for each row returned I am displaying a collapsiblePanelExtender and when the user clicks on the collapsiblePanelExtender it displays the results of the InnerGridview.

My problem is that it takes several minutes for all data to be returned so what I am thinking is this:

Return a record for each OuterGridview since this is only displaying one field (a ProductCategoryID) and then when the user clicks on the collapsiblePanelExtender call some function, probably an AJAX page that will query the database and then fill the InnerGridview for the results (products) based on the selected ProductCategoryID.

has anyone done something like this?

I've done something similar with linkbuttons but never with CollapsiblePanelExtenders.



Collapse a CollapsiblePanelExtender control if user clicks anywhere on the page


 How can I collapse a CollapsiblePanelExtender control when the user clicks anywhere except the control itself. Let me explain more: I have a CPE on my page containing other controls. When I click on the control, it expands and when I click the control again it collapse. If expanded and user clicks anywhere on the page, it still is expanded. I need to set it to collapse. On the page I have a button and I was able to write the code to collapse if user clicks the button. But where/how can I collapse if user clicks on any other control or on the page itself? What event or method?

I am using CPE.Collapse = true and CPE.ClientState = "true". I can't write the same code in all the controls on page. There should be some easier way to do so. PLEASE HELP!!


Collapsiblepanelextender Help




I have a series of collapsible panel extenders on my page and each time the page opens or postsback the panels open for a time and then close.  Is there a way to prevent this???



CollapsiblePanelExtender - Microsoft JScript runtime error: Sys.InvalidOperationException js Error:


Dear All,

I am using a Master-detail gridview (gridview inside a gridview) and have a CollapsiblePanelExtender that opens the child gridview.

I have put the CollapsiblePanelExtender in the Itemtemplate of the parent gridview. Hence, for every item in the parent gridview, CollapsiblePanelExtender with duplicate id's are getting generated. I get this js error on load of the page: Microsoft JScript runtime error: Sys.InvalidOperationException: Two components with the same id 'cpe' can't be added to the application.

Below is  my html code:


    <form id="form1" runat="server">

    <ajaxToolkit:ToolkitScriptManager ID="ScriptManager1" runat="server" />

    <div id="dlg" style="width: 700px">

        <asp:Panel ID="pnlDFS" runat="server">

            <asp:GridView ID="gvDFSLinks" Width="100%" AllowPaging="True" AutoGenerateColumns="False"

                runat="server" ShowHeader="False" O

CollapsiblePanelExtender not working.


 Hi Community

    I am using Visual Studio 2008 v3.5 with Ajax. I am using the ToolkitScriptManager
AND CollapsiblePanelExtender.

1 - I downloaded  Version 40412   AJAX Control Toolkit .NET 3.5
2 -  Added the tab to Visual Studio
3 - Browsed and added AjaxControlToolkit.dll to the bin folder and to Visual Studio Toolbox.

One problem was that I was not able to drag and drop the CollapsibleExtender in Design View because it only a showed the circle with the line thru it which means it wasn't available so I added ithe CollapsiblePanelExtender code into Source View . 

The only Extender that can be dragged and dropped from the Ajax Toolkit were AsyncFileUpload and  Seadragon because they both had icons next to them in the Toolbox that were shaped like "screws" and colored purple.  The rest of the icons in the Ajax Toolbox had different pictorial icons next tho them in the Ajax Control Toolkit.

The goal was to create a web site who's web page had a sidebar menu that used a CollapsibleExtender.  There are 2 Depts in the CollapsiblePanelExtender, and only the title "Dept 1" or "Dept 2" on the CollapsibleExtender should show in the side bar.

Then if you click on either Dept1 or Dept2 the sidebar menu  should expand and that Dept should then

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend