Santry Technology Solutions, Content Management, DotNetNuke, SharePoint Consulting
Register | Login
Tuesday, December 02, 2008

Sections
  
About Us
  
Partners
Downloads
  
 WWWCoder.com Resource Directory

 

ORDER TODAY!
Professional DotNetNuke ASP.NET Portals
Amazon.com now has the only DotNetNuke book you'll ever need. Written by the guys who brought you DotNetNuke, Shaun Walker, Patrick Santry, Joe Brinkman, Dan Caron, Scott McCulloch, Scott Willhite, and Bruce Hopkins. Order it now! .

Creating DotNetNuke MultiPage Modules
11/26/2003 9:44:57 PM

The DotNetNuke portal framework allows the developer to define a single desktop control and a single edit control.This article will show you how to create DotNetNuke modules which have multiple desktop and multiple edit controls.

Introduction

The DotNetNuke portal framework allows developers to create custom modules to extend the functionality provided by the base portal installation.  The framework allows the developer to define a single desktop control and a single edit control.   This limitation has led developers to create elaborate controls which consist of multiple panels.  As the user navigates to different states within the module, different panels are displayed or hidden.  This approach makes module maintenance very difficult and mixes the programming logic from different functional areas of the module.

In order to separate functionality and ease module development and maintenance, I developed a Multi-Page framework that utilizes a concept similar to the way DNN dynamically injects modules into a content pane on a tab.  By using a single "dispatch" control and passing in a page identifier, the developer is free to create elaborate modules with as many pages as required to meet the module requirements.

Define a Dispatch PortalModuleControl

The first step is to create a new "module".   This module will have a dispatcher for the desktop functionality and a dispatcher for the edit functionality.  Both dispatcher controls follow the same design.  So lets look at the Dispatcher code:  The first half of the Page_Load event identifies the module page to be loaded.  The second half of this event loads the appropriate PortalModuleControl, sets the ModuleConfiguration information and adds it to the dispatcher control collection.

Public Class Dispatch
Inherits PortalModuleControl
Dim _DefaultPage As String = "~/DeskTopModules/MultiPageModule/Page1.ascx"
 Private Sub Page_Load(ByVal sender As System.Object, ByVal e_
     As System.EventArgs) Handles MyBase.Load
If Not (Request.Params("PageID") Is Nothing) Then
Dim ForumPage As Integer = CInt(Request.Params("PageID"))
Select Case ForumPage
Case Utility.MultipageDesktopType.Page1
                    _DefaultPage = "~/DeskTopModules/MultiPageModule/Page1.ascx"
Case Utility.MultipageDesktopType.Page2
                    _DefaultPage = "~/DeskTopModules/MultiPageModule/Page2.ascx"
End Select
End If
        ' This code adds the appropriate control to the 
        ' dispatcher's child control collection
Dim objModule As PortalModuleControl = CType(CType(Me.Page, _
    BasePage).LoadModule(_DefaultPage), PortalModuleControl)
If Not objModule Is Nothing Then
objModule.ModuleConfiguration = Me.ModuleConfiguration
            Controls.Add(objModule)
End If
    End Sub
    Private Sub cmdPage1_Click(ByVal sender As Object, ByVal e_
          As System.EventArgs) Handles cmdPage1.Click
        Response.Redirect(Utility.BuildDesktopLink(Me.TabId, _
          Utility.MultipageDesktopType.Page1), True)
End Sub
Private Sub cmdPage2_Click(ByVal sender As Object, ByVal e_
          As System.EventArgs) Handles cmdPage2.Click
        Response.Redirect(Utility.BuildDesktopLink(Me.TabId, _
          Utility.MultipageDesktopType.Page2), True)
End Sub
End Class

The dispatcher ascx file is very simple.  It contains the ModuleTitle control that is displayed for all desktop pages.  The edit screen dispatcher has a separate ModuleTitle.

<%@ Register TagPrefix="Portal" TagName="Title" 
Src="~/controls/DesktopModuleTitle.ascx"%>
<%@ Control Language="vb" AutoEventWireup="false" 
Codebehind="Dispatch.ascx.vb" Inherits="MultiPageModule.Dispatch" %>
<portal:title id="Title1" EditText="Edit Screens" runat="server">
</portal:title><BR>

See the attached code for a fully working module which demonstrates this concept.

Written by Joe Brinkman, Joe can be reached via email at joe.brinkman@TAG-Software.net or visit his Website at http://www.tag-software.net.


Page Options:
format for printing  Format for Printer
email article  Email Page
add to your favorites   Add to Favorites
How would you rate the quality of this content?
Poor - - Excellent
Comments?
Overall Rating:
Comments Left:
Left on 3/21/2008 8:56:45 PM by Anonymous
Comments:
Left on 5/10/2005 8:42:16 AM by Anonymous
Comments: Wonderful!
Left on 10/15/2004 11:46:18 AM by Anonymous
Comments: The Download links are not working. Pls take care of those.
No ratings available.
Left on 10/12/2004 11:52:55 PM by Anonymous
Comments: need download
No ratings available.
Left on 9/26/2004 3:08:29 PM by q q
Comments: Download is broke??
No ratings available.
Left on 8/17/2004 8:05:30 PM by Anonymous
Comments: this works real well - good job mate.
  

 Latest Articles
  

 Latest News
  

 

Spotlight
Syndication

 


 


Digg This
 


DotNetNuke Platinum Benefactor

  
 

 Terms Of Use | Privacy Statement
 Copyright 2008 - Santry Technology Solutions, Box 172, Girard, PA 16417, (814) 774-0970