Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Sectionhead Control - persistSectionhead Control - persist
Previous
 
Next
New Post
11/25/2008 4:58 PM
 

I am using the section head control to open make a sort of table of contents for a large page

I want to persist on the server which sectionheads are open and which are closed so the person is always presented with the view they had the last time thay came to the server - i really want to avoid a postback with each sectionhead open so I was thinking of using the Client API component but not sure if thats the right method to achieve this

 

Can anybody please give me some advice !!!!!!


Dylan Barber http://www.braindice.com - Dotnetnuke development classes - skins and modules
 
New Post
11/26/2008 10:12 PM
Accepted Answer 

The SectionHeadControl is hardcoded to persist its open/closed state via the page's v13wstat3. However, the underlying DNNClientAPI.EnableMinMax method does permit specification of two other ways to persist state - DNNClientAPI.MinMaxPersistanceType.Cookie and MinMaxPersistanceType.Personalization which as you can guess uses a client cookie or for registered users the DNN Profile/Personalization store.

I recall that rather than using the SectionHeadControl I made use of the EnableMinMax method with MinMaxPersistanceType.Cookie when the user was unauthenticated and MinMaxPersistanceType.Personalization when the user was authenticated to maintain user preference for a collapsable section in a view control of my EPrayer module. Here is a section of that code:

In the view control's .ascx markup:

<asp:Image id="btnFilterRequests" runat="server" border="0" /><asp:Label ID="lblFilterRequests" ResourceKey="lblFilterRequests.Text" CssClass="NormalBold" runat="server"></asp:Label>
<table id="tblFilterRequests" border="0" rules="none" cellpadding="2" width="100%" runat="server">
. . .
</table>

In the view control's codebehind (PreRender event handler):

Private Const minIcon As String = "images/minus.gif"
Private Const maxIcon As String = "images/plus.gif"
. . .
Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
   Dim persistanceType As DNNClientAPI.MinMaxPersistanceType
   If IsAnonymous Then
        persistanceType = DNNCLientAPI.MinMaxPersistanceType.Cookie
   Else
        persistanceType = DNNClientAPI.MinMaxPersistanceType.Personalization
   End If
   DNNClientAPI.EnableMinMax(btnFilterRequests, tblFilterRequests, True, Page.ResolveUrl(minIcon), Page.ResolveUrl(maxIcon), persistanceType)
End Sub

Since the content of each section will be downloaded from the server when the page is first rendered, there should be no postback each time a section is opened or closed that is displayed or hidden via css client side. I was surprised to find that the SectionHeadControl did not expose a property for specifying the MinMaxPersistanceType - would have saved having to write the above code.


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
11/27/2008 12:28 AM
 

After looking at the sectionhead control some more I came to about the same thing but i actually created a new control  with two new properties for the key and name of personalization - this way i can make sure that i pass in some values and can make sure each section head has a unique value that way one can be open and save each one when the person comes back -

 

anyway greeat mind think alike i guess !!!!


Dylan Barber http://www.braindice.com - Dotnetnuke development classes - skins and modules
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Sectionhead Control - persistSectionhead Control - persist


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out