<p>I have a CollapsiblePanelExtender that will not collapse.  I have "collapsed" set to true and all the ControlID set correctly.  I try to collapse and it goes through the animation but then expands almost instantly.  This is in an User Control with the following structure.</p>

<pre><code>&lt;asp:UpdatePanel ID="UpdatePanel1" runat="server"&gt;
   &lt;ContentTemplate&gt;
      &lt;asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            DataSourceID="odsPartners" Width="450px" BorderWidth="0"
            ShowHeader="false" ShowFooter="false" AllowSorting="true" 
           onrowdatabound="GridView1_RowDataBound"&gt;
         &lt;Columns&gt;
            &lt;asp:TemplateField HeaderText="Contract Partners" SortExpression="Name"&gt; 
               &lt;ItemTemplate&gt;
                  &lt;asp:Panel id="pnlRow" runat="server"&gt;
                     &lt;table&gt;
                          ...Stuff...
                     &lt;/table&gt;
                  &lt;/asp:Panel&gt;
                  &lt;ajaxToolkit:CollapsiblePanelExtender runat="server" ID="DDE"
                              Collapsed="true" ImageControlID="btnExpander" ExpandedImage="../Images/collapse.jpg" CollapsedImage="../Images/expand.jpg"
                              TargetControlID="DropPanel" CollapseControlID="btnExpander" ExpandControlID="btnExpander" /&gt;
                  &lt;asp:Panel ID="DropPanel" runat="server" CssClass="CollapsedPanel"&gt;
                     &lt;asp:Table ID="tblContracts" runat="server"&gt;
                        &lt;asp:TableRow ID="row" runat="server"&gt;
                           &lt;asp:TableCell ID="spacer" runat="server" Width="30"&gt;&amp;nbsp;&lt;/asp:TableCell&gt;
                           &lt;asp:TableCell ID="cellData" runat="server" Width="400"&gt;
                               &lt;uc1:ContractList ID="ContractList1" runat="server" PartnerID='&lt;%# Bind("ID") %&gt;' /&gt;
                           &lt;/asp:TableCell&gt;
                         &lt;/asp:TableRow&gt;
                      &lt;/asp:Table&gt;
                  &lt;/asp:Panel&gt;
               &lt;/ItemTemplate&gt;
            &lt;/asp:TemplateField&gt;
          &lt;/Columns&gt;
       &lt;/asp:GridView&gt;
    &lt;/ContentTemplate&gt;
   &lt;Triggers&gt;
       &lt;asp:AsyncPostBackTrigger ControlID="tbFilter" EventName="TextChanged" /&gt;
   &lt;/Triggers&gt;
&lt;/asp:UpdatePanel&gt;
</code></pre>

[{'answer_id': 26912, 'author': 'Ian Patrick Hughes', 'author_id': 2213, 'author_profile': 'https://Stackoverflow.com/users/2213', 'pm_score': 3, 'selected': True, 'text': '<p>I am sorry I do not have time to trouble-shoot your code, so this is from the hip.</p>\n\n<p>There is a good chance that this a client-side action that is failing. Make certain that your page has the correct doctype tag if you took it out of your page or masterPage. Furthermore, attempt to set the ClientState as well:</p>\n\n<p>DDE.ClientState = true;</p>\n\n<p>The issue is you have that thing wrapped inside of your TemplateField. I have ran into issues using the AjaxControlToolkit on repeated fields and usually side with using a lighter weight client-side option, up to and including rolling your own show/hide method that can be reused just by passing in an DOM understood id.</p>\n'}, {'answer_id': 26918, 'author': 'Dillie-O', 'author_id': 71, 'author_profile': 'https://Stackoverflow.com/users/71', 'pm_score': 0, 'selected': False, 'text': '<p>Also check that the you have the following property set:</p>\n\n<pre><code>AutoExpand="False"\n</code></pre>\n\n<p>One of the features of the collapsible panel is that it will auto expand when you put your mouse over it, and this tag will make sure that doesn\'t happen.</p>\n'}, {'answer_id': 27026, 'author': 'Craig', 'author_id': 2894, 'author_profile': 'https://Stackoverflow.com/users/2894', 'pm_score': 1, 'selected': False, 'text': '<p>After checking the AutoExpand (which strangley had no visible effect) I checked the DOC Type.  Sure enough.  That was the culprit.</p>\n\n<p>This is the correct one:</p>\n\n<pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" &gt; \n</code></pre>\n\n<p>Thanks Ian!</p>\n'}, {'answer_id': 28340499, 'author': 'user4532236', 'author_id': 4532236, 'author_profile': 'https://Stackoverflow.com/users/4532236', 'pm_score': -1, 'selected': False, 'text': '<p>It is working fine:</p>\n\n<pre><code>CollapsiblePanelExtender CpeForControls = (CollapsiblePanelExtender)tbl_Form.FindControl("cpe_controls");\nCpeForControls.ClientState = "true";\nCpeForControls.Collapsed = true;\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/26825', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2894/']