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.0Programmatically Move Module Within PaneProgrammatically Move Module Within Pane
Previous
 
Next
New Post
6/29/2006 12:00 AM
 

Hello,

I'm trying to programmatically move a module within a pane upon addition of another module to that same pane.  Basically the functionality you find in the Module Menu under Move (e.g. Move -> Top, Move -> Up, Move -> Down, Move -> Bottom).  

Ultimately, I want a specific module to always move to the bottom of the pane it is in, no matter how many modules are added to the pane.  In other words, if I have a moduleA, moduleB and moduleAlwaysAtBottom and I add moduleC, I want to move moduleAlwaysAtBottom when moduleC is added such that when the page refreshes I see moduleA, moduleB, moduleC, moduleAlwaysAtBottom within the pane.

I don't want to add moduleC to the bottom and then manually move it up or move moduleAlwaysAtBottom down.

I've found the ModuleInfo.ModuleOrder is used in the ControlPanel to set whether an added module is added at the top (<> -1) or the bottom (=-1).  However, changing the ModuleOrder has not worked for me.  Example;  I have moduleA and moduleB in the same pane.  Module A has a ModuleOrder value of 1.  On a button_click event in moduleA I set moduleA's ModuleOrder to -1.  This does NOT move it to the bottom as I expected from the ContentPanel Code.  In fact, it has no impact at all.

I've looked in the object browser for clues.  I see in the Object Browser that there are constants for these values (DotNetNuke.Entities.Modules.Actions.ModuleActionType) but don't see how to use them.

I've tried to use the ModuleController object method MoveModule but its method signature suggests it is for moving modules from tab to tab, not changing their order within a pane.

Thanks for any help,

Jorge

Environment:

DotNetNuke 4.0, VWD 2005, SQL Server Express 2005

 
New Post
6/29/2006 5:43 PM
 
You need to call ModuleController.UpdateModuleOrder()


Here's how they do it in Core DNN:

Select Case Command.CommandName
               
Case ModuleActionType.MoveTop
                    objModules.UpdateModuleOrder(PortalModule.TabId, PortalModule.ModuleConfiguration.ModuleID, 0, Command.CommandArgument)
               
Case ModuleActionType.MoveUp
                    objModules.UpdateModuleOrder(PortalModule.TabId, PortalModule.ModuleConfiguration.ModuleID, PortalModule.ModuleConfiguration.ModuleOrder - 3, Command.CommandArgument)
               
Case ModuleActionType.MoveDown
                    objModules.UpdateModuleOrder(PortalModule.TabId, PortalModule.ModuleConfiguration.ModuleID, PortalModule.ModuleConfiguration.ModuleOrder + 3, Command.CommandArgument)
               
Case ModuleActionType.MoveBottom
                    objModules.UpdateModuleOrder(PortalModule.TabId, PortalModule.ModuleConfiguration.ModuleID, (PortalModule.ModuleConfiguration.PaneModuleCount * 2) + 1, Command.CommandArgument)
            End Select
 
New Post
7/2/2006 7:50 PM
 
Thanks csalee!  Appreciate the response and the code sample.
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Programmatically Move Module Within PaneProgrammatically Move Module Within Pane


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