开发者_Python百科
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this questionI need To make Dynamic Collapsible Panel in ASP.NET using C#.
What is the best way to do this?
You can use the collapsible panel extender of the Ajax Control Toolkit, or one of the jQuery plugins listed here.
You can also use jQuery UI's accordion widget for that purpose.
My best bet would be using JQuery and in Javascript slideUp/slideDown the containing the panel.
Something like this:
<div id="pnlPanelHeader">
Caption <a href="#" onclick="$('#pnlPanel').toggle();return false;">Toggle</a>
</div>
<asp:Panel ID="pnlPanel" runat="server" ClientIDMode="Static">
Content to be collapsed
</asp:Panel>
Telerik have a free (for non-commercial use) library of controls (both ASPX and Razor), which include what you're asking for:
http://demos.telerik.com/aspnet-mvc/razor/panelbar
精彩评论