Search code examples
asp.netajaxajaxcontroltoolkitcollapsiblepanelextender

Collapsible Panel in ASP.NET


I am using the ASP.NET AJAX Control Kit and I am having a problem using a collapsible panel in my code. I have the following code:

<table><tr>
<td class="bg">
    <a class="bg" href="javascript:void(0);">
    <asp:CheckBox runat="server" ID="chkSMSGrossRevenue" Text="Gross Revenue (Daily, Monthly, Yearly)" /></a>
    <asp:Panel runat="server" ID="pnlSMSGrossRevenue" Height="0">
        testing
    </asp:Panel>
</td></tr></table>
<cc1:CollapsiblePanelExtender runat="server" ID="cpeSMSGrossRevenue" TargetControlID="pnlSMSGrossRevenue"
    ExpandControlID="chkSMSGrossRevenue" CollapseControlID="chkSMSGrossRevenue">
</cc1:CollapsiblePanelExtender>

What I'm trying to do is expand my panel whenever there is a checkmark in my checkbox and collapse it when there is no checkmark. The problem is, I always see the work "test", which is in my panel...so I'm assuming its never collapsing. When I click the checkbox, it collapses, but then immediately re-expands again. Can anyone tell me what I'm doing wrong?


Solution

  • I figured out the issue. It has to do with my tag at the top of my page