DotNetNuke Modules – Collapsible Panels

Last week we looked at how to add the ability to collapse a container as part of the DotNetNuke skinning series. Today, we are going to take a look at how to add a similar feature into the modules themselves.

By the way, while it might work for a person interested in skinning to skip the series on creating modules, I think those of you interested in building modules really ought to take a look at the skinning series.

To get a panel to expand and collapse, we need to use the SectionHeadControl. You can register this control in your module by placing the following code at the top of your ASCX page:

<%@ Register Src="~/controls/SectionHeadControl.ascx"
TagName="SectionHead" TagPrefix="DNN" %>

The code to use this control looks something like:

<DNN:SectionHead CssClass="Header"
    runat="server"  ID="m_sectionHeadImageSection"
    IsExpanded="false" Section="m_ImageSection"
    Text="Some Label Text Here" />

The Section attribute points to the ID of the section that wraps around the content you want to hide or show. This should not be a control with the runat=”server” attribute assigned to it.

Here is a full list of attributes that you have available:

Attribute Description
IncludeRule True or False. True shows a horizontal rule (HR tag) under the text.
IsExpanded True or False. Controls the initial state of the panel being controlled.
MaxImageUrl Overrides the default image for maximize
MinImageUrl Overrides the default image for minimize
Section Points to the control this control is going to expand and collapse.
Text The text to display at the location where this control is regardless of the expanded or collapsed state of the control it is pointing to.
ResourceKey For localization as we’ve discussed before

 


Other post in DotNetNuke - Module Development

Other Related Items:

Floating Leaf and Debris Pond Net - 7 ft. x 10 ft.Floating Leaf and Debris Pond Net - 7 ft. x 10 ft.Protect your fish from predators and keep the autumn leaves out with Supreme Floating Pond Netting. Tough, durable netting floats on surface for easy set up and removal.
Pro ASP.NET MVC FrameworkPro ASP.NET MVC Framework

Steven Sanderson has seen the ASP.NET MVC framework mature from the start, so his experience, combined with comprehensive coverage of all the new f... Read More >

Bdg Bdgasp.net Publishing Mastering Asp.net [windows/macintosh]Bdg Bdgasp.net Publishing Mastering Asp.net [windows/macintosh]Mastering asp.Net gives new programmers the ability to use this incredible new tool as if they were an old pro! master the flow and management of your data with this powerful learning tool!

If you're new here, you may want to subscribe to the mailing list to get notifications of new post and a virtual tour of past topics. Thanks for visiting!

Most Commented Post

Comments are closed.

DotNetNuke Sponsor

 

Most Valuable Blogger
Sponsor