title: collapsible panel not loading correctly
body: <p>I'm having an intermittent problem with the CollapsiblePanelExtender. </p>
  
  <p>The way we are using them is to wrap it around a gridview, so that only the header-row is displayed(which contains a checkbox for select all) while collapsed. The page always load as collapsed.</p>
  
  <p>about 95% of the time, this will work perfectly fine, however, once in a while the cpe loads with the right height set, but display:none as style instead of display:block.</p>
  
  <p>This results in the panel being fully "collapsed". It's still possible to extend it, and when you subsequently collapse it, it works as intended. </p>
  
  <p>Have anyone else experienced the same kind of issues with CPE?</p>
  
  <p>Main usercontrol:</p>
  
  <pre><code>&lt;%@ Control Language="C#" AutoEventWireup="true" CodeFile="FlightFareExplorer.ascx.cs"
      Inherits="UserControls_Rowfilters_FlightFareExplorer" %&gt;
  &lt;%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %&gt;
  &lt;%@ Register Src="FareBasis.ascx" TagName="FareBasis" TagPrefix="uc4" %&gt;
  &lt;%@ Register Src="Flight.ascx" TagName="Flight" TagPrefix="uc3" %&gt;
  &lt;%@ Register Assembly="BusyBoxDotNet" Namespace="BusyBoxDotNet" TagPrefix="busyboxdotnet" %&gt;
  &lt;busyboxdotnet:BusyBox ID="bsbWait" runat="server" Position="Center" ShowBusyBox="Custom"
      Image="Custom" OverlayOpacity="25" ImageUrl="/Images/Misc/logo_anim.gif" Text="Your query is currently being processed" /&gt;
  &lt;asp:UpdatePanel ID="upHeader" ChildrenAsTriggers="false" UpdateMode="Conditional"
      runat="server"&gt;
      &lt;ContentTemplate&gt;
          &lt;cc1:AnimationExtender runat="server" ID="aeTest" TargetControlID="pnlMenu"&gt;
              &lt;Animations&gt;
                  &lt;OnClick&gt;
                      &lt;Sequence&gt;
                          &lt;StyleAction AnimationTarget="pnlSettings" attribute="display" value="none" /&gt;
                          &lt;StyleAction AnimationTarget="pnlSettings" attribute="zIndex" value="-100" /&gt;
                          &lt;StyleAction AnimationTarget="pnlMenu" attribute="display" value="none" /&gt;
                     &lt;/Sequence&gt;
                  &lt;/OnClick&gt;
              &lt;/Animations&gt;
          &lt;/cc1:AnimationExtender&gt;
          &lt;cc1:AnimationExtender runat="server" ID="AnimationExtender1" TargetControlID="pnlHeader"&gt;
              &lt;Animations&gt;
          &lt;OnClick&gt;
              &lt;Sequence&gt;
                  &lt;StyleAction AnimationTarget="pnlMenu" attribute="display" value="block" /&gt;
                  &lt;StyleAction AnimationTarget="pnlSettings" attribute="zIndex" value="1000" /&gt;
                  &lt;StyleAction AnimationTarget="pnlSettings" attribute="display" value="inline" /&gt;
             &lt;/Sequence&gt;
          &lt;/OnClick&gt;
              &lt;/Animations&gt;
          &lt;/cc1:AnimationExtender&gt;
          &lt;div style="height: 18px; overflow: hidden;"&gt;
              &lt;div onclick="__doPostBack('&lt;%= upFlightFare.ClientID %&gt;', 'Open');"&gt;
                  &lt;asp:Panel runat="server" ID="pnlHeader" CssClass="boxDataHead" Width="100%" onmouseover="document.body.style.cursor='pointer';"
                      onmouseout="document.body.style.cursor='default';"&gt;
                      &lt;asp:Label runat="server" ID="lblHeader"&gt;Flight/Fare Details&lt;/asp:Label&gt;
                      &lt;asp:Image runat="server" ID="imgCollapsed" ImageUrl="~/Images/Misc/Pil_h_7x7_wh_bggreen.gif" /&gt;
                  &lt;/asp:Panel&gt;
              &lt;/div&gt;
              &lt;div onclick="__doPostBack('&lt;%= upFlightFare.ClientID %&gt;', 'Close');"&gt;
                  &lt;asp:Panel runat="server" ID="pnlMenu" CssClass="boxDataHead float" Width="100%"
                      onmouseover="document.body.style.cursor='pointer';" onmouseout="document.body.style.cursor='default';"&gt;
                      &lt;asp:Label runat="server" ID="lblMenu"&gt;Flight/Fare Details(Click here to close)&lt;/asp:Label&gt;
                      &lt;asp:Image runat="server" ID="imgExpanded" ImageUrl="~/Images/Misc/Pil_ned_7x7_wh_bggreen.gif" /&gt;
                  &lt;/asp:Panel&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/ContentTemplate&gt;
  &lt;/asp:UpdatePanel&gt;
  &lt;asp:Panel runat="server" ID="pnlSettings" CssClass="FFE"&gt;
      &lt;asp:UpdateProgress ID="upExplorer" runat="server" AssociatedUpdatePanelID="upFlightFare"
          DisplayAfter="50"&gt;
          &lt;ProgressTemplate&gt;
              &lt;table border="0"&gt;
                  &lt;tr&gt;
                      &lt;td rowspan="2"&gt;
                          &lt;asp:Image ID="Image1" runat="server" ImageUrl="~/Images/Misc/logo_anim.gif" /&gt;
                      &lt;/td&gt;
                      &lt;td&gt;
                          &lt;p style="margin: 15px 10px 0px; font-weight: bold; font-style: normal; font-size: 11pt;
                              font-family: Verdana; color: black;"&gt;
                              Please wait&lt;/p&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td&gt;
                          &lt;p id="ctl00_cntMain_ucAnalysisSettings_bsbWaitText" style="margin: 20px 10px 15px;
                              font-weight: normal; font-style: normal; font-size: 8pt; font-family: Verdana;
                              color: black;"&gt;
                              Your query is currently being processed&lt;/p&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/table&gt;
          &lt;/ProgressTemplate&gt;
      &lt;/asp:UpdateProgress&gt;
      &lt;asp:UpdatePanel runat="server" ID="upFlightFare"&gt;
          &lt;ContentTemplate&gt;
              &lt;cc1:AnimationExtender runat="server" ID="AnimationExtender2" TargetControlID="btnResetSelection"&gt;
                  &lt;Animations&gt;
                  &lt;OnClick&gt;
                      &lt;Sequence&gt;
                          &lt;StyleAction AnimationTarget="pnlSettings" attribute="display" value="none" /&gt;
                          &lt;StyleAction AnimationTarget="pnlSettings" attribute="zIndex" value="-100" /&gt;
                          &lt;StyleAction AnimationTarget="pnlMenu" attribute="display" value="none" /&gt;
                     &lt;/Sequence&gt;
                  &lt;/OnClick&gt;
                  &lt;/Animations&gt;
              &lt;/cc1:AnimationExtender&gt;
              &lt;cc1:AnimationExtender runat="server" ID="AnimationExtender3" TargetControlID="btnClose"&gt;
                  &lt;Animations&gt;
                  &lt;OnClick&gt;
                      &lt;Sequence&gt;
                          &lt;StyleAction AnimationTarget="pnlSettings" attribute="display" value="none" /&gt;
                          &lt;StyleAction AnimationTarget="pnlSettings" attribute="zIndex" value="-100" /&gt;
                          &lt;StyleAction AnimationTarget="pnlMenu" attribute="display" value="none" /&gt;
                     &lt;/Sequence&gt;
                  &lt;/OnClick&gt;
                  &lt;/Animations&gt;
              &lt;/cc1:AnimationExtender&gt;
              &lt;div class="boxDataFullCtrl"&gt;
                  &lt;div style="text-align: right"&gt;
                      &lt;asp:Button ID="btnUpdate" runat="server" Text="Save &amp; Update" OnClick="btnUpdate_Click"
                          ToolTip="Saves your current selection and requeries the database" CssClass="ctrl ctrlABtnL" /&gt;
                      &lt;asp:Button ID="btnResetSelection" runat="server" Text="Reset" OnClick="btnResetSelection_Click"
                          ToolTip="Resets all filters and closes the window" CssClass="ctrl ctrlABtn" /&gt;
                      &lt;asp:Button ID="btnClose" runat="server" Text="Close" ToolTip="Closes the window without saving your changes"
                          CssClass="ctrl ctrlABtn" /&gt;
                  &lt;/div&gt;
                  &lt;table border="0"&gt;
                      &lt;tr&gt;
                          &lt;td valign="top"&gt;
                              &lt;uc3:Flight ID="ucFlightOutFilter" runat="server" ReturnFlights="false" SessionKey="Out" /&gt;
                              &lt;br /&gt;
                              &lt;uc4:FareBasis ID="ucFareBasisOutFilter" runat="server" ReturnFares="false" SessionKey="Out" /&gt;
                          &lt;/td&gt;
                          &lt;td valign="top"&gt;
                              &lt;uc3:Flight ID="ucFlightHomeFilter" runat="server" ReturnFlights="true" SessionKey="Home" /&gt;
                              &lt;br /&gt;
                              &lt;uc4:FareBasis ID="ucFareBasisHomeFilter" runat="server" ReturnFares="true" SessionKey="Home" /&gt;
                          &lt;/td&gt;
                      &lt;/tr&gt;
                  &lt;/table&gt;
              &lt;/div&gt;
          &lt;/ContentTemplate&gt;
          &lt;Triggers&gt;
              &lt;asp:PostBackTrigger ControlID="btnUpdate" /&gt;
          &lt;/Triggers&gt;
      &lt;/asp:UpdatePanel&gt;
  &lt;/asp:Panel&gt;
  </code></pre>
  
  <p>Embedded usercontrol:</p>
  
  <pre><code>&lt;%@ Control Language="C#" AutoEventWireup="true" CodeFile="Flight.ascx.cs" Inherits="UserControls_FlightFilter" %&gt;
  &lt;%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %&gt;
  &lt;table border="0" cellpadding="3"&gt;
      &lt;tr&gt;
          &lt;td style="background-color: #F8F8F8;"&gt;
              &lt;cc1:CollapsiblePanelExtender runat="server" ID="cpeFlights" TargetControlID="pnlFlightsContent"
                  CollapsedSize="0" Collapsed="false" ExpandControlID="pnlFlightsHeader" CollapseControlID="pnlFlightsHeader"
                  ExpandDirection="Vertical" ImageControlID="imgHeaderExpand" CollapsedImage="~/Images/Misc/plus.gif"
                  ExpandedImage="~/Images/Misc/minus.gif" SuppressPostBack="true" /&gt;
              &lt;asp:Panel ID="pnlFlightsHeader" runat="server"&gt;
                  &lt;asp:ImageButton ID="imgHeaderExpand" CommandName="Expand" runat="server" ImageUrl="~/Images/Misc/plus.gif" /&gt;
                  &lt;asp:Label ID="lblHeader" runat="server" Style="font-weight: bold;"&gt;Flights&lt;/asp:Label&gt;
              &lt;/asp:Panel&gt;
              &lt;asp:Panel ID="pnlFlightsContent" runat="server"&gt;
                  &lt;asp:Label ID="lblNoDataWarning" runat="server" CssClass="ctrl err" Visible="false"&gt;We we're unable to locate any flights for your current search parametres.&lt;/asp:Label&gt;
                  &lt;asp:Repeater runat="server" ID="rptFlights" OnItemDataBound="rptFlights_ItemDataBound"&gt;
                      &lt;ItemTemplate&gt;
                          &lt;cc1:CollapsiblePanelExtender runat="server" ID="cpeGrid" TargetControlID="pnlFlight"
                              CollapsedSize="22" Collapsed="true" ExpandControlID="pnlOpenClose" CollapseControlID="pnlOpenClose"
                              ExpandDirection="Vertical" ImageControlID="imgExpand" CollapsedImage="~/Images/Misc/plus.gif"
                              ExpandedImage="~/Images/Misc/minus.gif" SuppressPostBack="true" /&gt;
                          &lt;asp:PlaceHolder runat="server" ID="plhCarrier" Visible="false"&gt;
                              &lt;asp:Panel runat="server" ID="pnlOpenClose"&gt;
                                  &lt;asp:Label runat="server" ID="lblCount" Style="float: right; padding-right: 4px;
                                      color: #008800; font-weight: bold;"&gt;&lt;/asp:Label&gt;
                                  &lt;div id="spnWeekHeader" class="tblHead" style="width: 207px; font-size: 11px; font-weight: bold;
                                      border: solid 1px black; border-bottom: 0px;" runat="server"&gt;
                                      &lt;asp:ImageButton ID="imgExpand" CommandName="Expand" runat="server" ImageUrl="~/Images/Misc/plus.gif" /&gt;
                                      &lt;asp:Label runat="server" ID="lblrepeater"&gt;TEST&lt;/asp:Label&gt;
                                  &lt;/div&gt;
                              &lt;/asp:Panel&gt;
                              &lt;asp:Panel runat="server" ID="pnlFlight" Height="22px" Style="overflow: hidden;"&gt;
                                  &lt;asp:GridView ID="gdvFlights" runat="server" AutoGenerateColumns="false" OnRowDataBound="gdvFlights_RowDataBound"
                                      OnDataBound="gdvFlights_DataBound" CssClass="tbl ctrl"&gt;
                                      &lt;RowStyle BorderColor="black" BorderWidth="1px" BorderStyle="Solid" /&gt;
                                      &lt;AlternatingRowStyle CssClass="altRow" /&gt;
                                      &lt;HeaderStyle CssClass="tblHead" Wrap="true" /&gt;
                                      &lt;Columns&gt;
                                          &lt;asp:TemplateField HeaderStyle-CssClass="tblHeadAdv" ItemStyle-HorizontalAlign="Center"&gt;
                                              &lt;HeaderTemplate&gt;
                                                  &lt;asp:CheckBox ID="chkSelectAllFlight" runat="server" Checked="false" AutoPostBack="false" /&gt;
                                              &lt;/HeaderTemplate&gt;
                                              &lt;ItemTemplate&gt;
                                                  &lt;asp:CheckBox ID="chkSelectFlight" runat="server" Checked="false" AutoPostBack="false" /&gt;
                                              &lt;/ItemTemplate&gt;
                                          &lt;/asp:TemplateField&gt;
                                          &lt;asp:BoundField DataField="FlightNo" HeaderText="Flight Number" HeaderStyle-CssClass="tblHeadAdv"
                                              ItemStyle-HorizontalAlign="Center" /&gt;
                                          &lt;asp:BoundField DataField="Origin" HeaderText="Origin" HeaderStyle-CssClass="tblHeadAdv"
                                              ItemStyle-HorizontalAlign="Center" /&gt;
                                          &lt;asp:BoundField DataField="Destination" HeaderText="Destination" HeaderStyle-CssClass="tblHeadAdv"
                                              ItemStyle-HorizontalAlign="Center" /&gt;
                                          &lt;asp:BoundField DataField="POS" HeaderText="POS" HeaderStyle-CssClass="tblHeadAdv"
                                              ItemStyle-HorizontalAlign="Center" /&gt;
                                          &lt;asp:BoundField DataField="Carrier" HeaderText="Carrier" HtmlEncode="false" HeaderStyle-CssClass="tblHeadAdv"
                                              ItemStyle-HorizontalAlign="Center" /&gt;
                                          &lt;asp:BoundField HeaderText="Dep. time" DataField="DepartureTime" HtmlEncode="false"
                                              HeaderStyle-CssClass="tblHeadAdv" ItemStyle-HorizontalAlign="Center" /&gt;
                                          &lt;asp:BoundField DataField="StopOver" HeaderText="Via" HeaderStyle-CssClass="tblHeadAdv"
                                              ItemStyle-HorizontalAlign="Center" /&gt;
                                      &lt;/Columns&gt;
                                  &lt;/asp:GridView&gt;
                              &lt;/asp:Panel&gt;
                          &lt;/asp:PlaceHolder&gt;
                          &lt;br /&gt;
                      &lt;/ItemTemplate&gt;
                  &lt;/asp:Repeater&gt;
              &lt;/asp:Panel&gt;
          &lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/R1yCL.jpg" alt="http://img208.imageshack.us/gal.php?g=workingp.jpg"></p>
  
  <p><img src="https://i.stack.imgur.com/QbBi7.jpg" alt="http://img208.imageshack.us/gal.php?g=workingp.jpg"></p>