Hello.
I have the following scenario.
I want to use CollapsiblePanelExtender from AjaxControlToolkit to make a collapsed panel.
However, the content that this panel will display will be dynamic and will be inside a div.
My div already exists and inside it there are several controls and I want to add this whole div inside the asp: Panel that will be displayed by CollapsiblePanelExtender.
If I could do this via codebehind I would just use the:
Painel.Controls.Add(div);
But I want to add this div to my dashboard via jquery or javascript.
How can I do this?
HTML (Panels to mount or Collapse)
<asp:Panel ID="painelCollapsedCabecalho" runat="server" CssClass="cpHeader">
<asp:Label ID="lblCabacalho" runat="server" Text="Click here" />
</asp:Panel>
<asp:Panel ID="painelCollapsedCorpo" runat="server" CssClass="cpBody"/>
<cc1:CollapsiblePanelExtender ID="cpeCollapsed" runat="server" TargetControlID="painelCollapsedCorpo"
CollapseControlID="painelCollapsedCabecalho" ExpandControlID="painelCollapsedCabecalho"
Collapsed="true" TextLabelID="lblCabacalho" CollapsedText="Click to Show Search..."
ExpandedText="Click to Hide Search..." CollapsedSize="0" BehaviorID="collapsibleBehavior" />
Script (This is how I intended to add the div to my asp: Panel, but it does not work.)
<script type="text/javascript">
function pageLoad(sender, args) {
$("#painelCollapsedCorpo").append($("#divPesquisar"));
}
</script>