?
Solved

Unable to reset ajaxToolkit CollapsiblePanel Extender state

Posted on 2009-05-06
5
Medium Priority
?
478 Views
Last Modified: 2012-06-27
Hi Experts,

after answering questions here for quite a while now i finally ran into a problem i cannot seem to solve myself so here's my first EE question.

Following Scenario:

Two panels, one visible, one unvisible. The visible panel has a button "Add" which hides the visible panel and unhides the unvisible panel with an input form.

Inside of this panel there's an AJAX Toolkit CollapsiblePanel extender. Both the CollapseControlID and ExpandControlID properties are set to a Checkbox outside of the panel that gets collapsed and expanded. The Checkbox is checked by default. The Panel is collapsed by default and AutoCollapse is set to false. If the Checkbox gets unchecked the Panel expands and displays some textboxes. If the Checkbox gets checked again the panel collapses. This works just as expected.
 
Below the collapsiblepanel there's a cancel button which resets all input controls to their default state and hides the form panel and shows the original panel again with the "Add" button.

If i now click "Cancel" with the panel in expanded state and click "Add" again all controls are in its original state except for the CallibsiblePanel which is expanded even though the CheckBox which controls it is Checked. This makes my form go totally out of sync as unchecking the checkbox now collapses the panel.

I tried multiple things to have the CollapsblePanel be reset to its original collapsed state:

In the OnClick event of the cancel button as advised by posts found on the msdn forums (also tried this in the Page_Load as a test to no avail):
_myCollapsiblePanelExtender.Collapsed = true;
_myCollapsiblePanelExtender.ClientState = "true";

I also tried adding a OnClientClick event to the Cancel button and collapse the panel on client side via javascript (The extender had its BevhaviorID set to "csvPosPanel":
function ClosePosPanel() { $find("csvPosPanel").collapsePanel(); }

Nothing worked so far. If anything is unclear feel free to ask for clarification.

Any educated advice is greatly appreciated. Thanks!
0
Comment
Question by:tillgeffken
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 2

Accepted Solution

by:
yaantbarb earned 2000 total points
ID: 24316357
Hi there,

I haven't found a definitive reason for this behaviour but i've found that by setting the collapse panel extenders EnableViewState property to "false" it seems to fix it.

I'm still looking for an actual reason for the behavior but hopefully this will help you for now.
0
 
LVL 9

Author Comment

by:tillgeffken
ID: 24316629
Hey vaantbarb,

that indeed fixes the symptoms. I have tested one million things but that i didn't try. From what i have tested so far it does not break other parts of my web form either so i might end up using this workaround.

However i'm still wondering why this could be happening. Also what if i ever need the extender to be in ViewState?

I'll leave this question open for a little longer - maybe you or someone else comes up with an explanation.

Thanks alot so far!


0
 
LVL 2

Assisted Solution

by:yaantbarb
yaantbarb earned 2000 total points
ID: 24316844
Hi again,

I've still not found an explanation for the bug but another workaround would be to set the collapse panel extenders Collapsed and ClientState properties to True and "true" in the Click event for the Add button.
0
 
LVL 9

Author Comment

by:tillgeffken
ID: 24373490
I posted this issue on the ASP.NET forums aswell but it seems that this is either considered expected behavior or noone knows a Solution/Explanation - the thread got 0 replies. Closing the question, awarding points to vaantharb for a work-around.
0
 
LVL 9

Author Closing Comment

by:tillgeffken
ID: 31578395
Thanks mate. Accepting both as solution as one might need, or not need, viewstate on the control.
0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question