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

HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Load ModuleContentLoad ModuleContent
Previous
 
Next
New Post
6/28/2007 4:53 AM
 

I want to load ModuleContent of other tab modules without its container into such webcontrol like panel.it's something like what adding existing module in controlpanel do.The difference is that adding existing module ,add module with container in skin pane but i want to add only ModuleContent (without container) in panel of my own module.my written code is below but it doesn't work.please help me.
Public Sub LoadModule()
            Try
                Dim objPortalModuleBase As Entities.Modules.PortalModuleBase = Nothing
                'get module info from PortalID:0 ,TabID:56 ,ModuleID:404
                Dim objModule As ModuleInfo = ObjController.GetModuleInfo(0, 56, 404)
                Dim objPanel As New Panel
                objPanel.ID = "ModuleContent"
                ' module content visibility options
                Dim blnContent As Boolean = PortalSettings.ContentVisible

                If blnContent Then
                    ' if the module supports caching and caching is enabled for the instance and the user does not have Edit rights or is currently in View mode
                    If objModule.DefaultCacheTime <> -1 AndAlso objModule.CacheTime <> 0 AndAlso (PortalSecurity.HasEditPermissions(objModule.ModulePermissions) = False Or PortalSettings.UserMode = PortalSettings.Mode.View) Then
                        ' use output caching
                        objPortalModuleBase = New PortalModuleBase
                    Else
                        ' load the control dynamically
                        If objModule.ControlSrc.ToLower.EndsWith(".ascx") Then
                            ' load from a user control on the file system
                            objPortalModuleBase = CType(Me.LoadControl("~/" & objModule.ControlSrc), PortalModuleBase)
                        Else
                            ' load from a typename in an assembly ( ie. server control )
                            Dim objType As System.Type = Framework.Reflection.CreateType(objModule.ControlSrc)
                            objPortalModuleBase = CType(Me.LoadControl(objType, Nothing), PortalModuleBase)
                        End If
                    End If

                    ' set the control ID to the resource file name ( ie. controlname.ascx = controlname )
                    ' this is necessary for the Localization in PageBase
                    objPortalModuleBase.ID = System.IO.Path.GetFileNameWithoutExtension(objModule.ControlSrc)

                Else       ' content placeholder
                    objPortalModuleBase = CType(Me.LoadControl("~/admin/Portal/NoContent.ascx"), PortalModuleBase)
                End If

                objPortalModuleBase.ModuleConfiguration = objModule


                ' module user control processing
                If Not objPortalModuleBase Is Nothing Then
                    objPanel.Controls.Add(objPortalModuleBase)
                End If

                'add objPanel to my own Panel(Panel1)
                Panel1.Controls.Add(objPanel)

                If Not objPortalModuleBase Is Nothing Then

                    ' force the CreateChildControls() event to fire for the PortalModuleBase ( the timing is critical for output caching )
                    objPortalModuleBase.FindControl("")

                    Dim objModuleContent As Panel = CType(objPortalModuleBase.Parent.FindControl("ModuleContent"), Panel)
                    If Not objModuleContent Is Nothing Then
                        objModuleContent.Visible = True
                    End If
                End If
            Catch ex As Exception
                ProcessModuleLoadException(Me, ex)
            End Try
        End Sub

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Skins, Themes, ...Skins, Themes, ...Load ModuleContentLoad ModuleContent


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