Products

Solutions

Resources

Partners

Community

About

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!

ProfileModuleUserControlBase

Return to previous page

  • 4/7/2015
  • 2119 Views

Comments

2119 Views

ProfileModuleUserControlBase

Last updated long time ago

Comments

Common

(Enter the content of this article below)

Advanced

 
ProfileModuleUserControlBase is an abstract class under the DotNetNuke.UI.Modules namespace. This class inherits from ModuleUserControlBase and also implements the IProfileModule interface. The primary purpose of this class is to provide module developers with a way to extend the core User Profile page with their own custom modules.

This class provides access to the ProfileUserId being viewed and the DisplayModule variable, which the developer sets, is used by the framework to determine if the module should be shown to the user viewing the page currently. If DisplayModule is set to true, the module will be visible to the user. When set to false, it will not be displayed. If you intend to only show the module to the user if they are the profile owner, you would have some logic like the following:

Return (ProfileUserId = CurrentViewingUserID)

There are multiple DotNetNuke Core/Corporation modules that utilize this class. The one being used for the examples below is the User Profile module available in every install (Community, Pro, Enterprise, etc.).

Example Code (VB)

Example code taken from core's User Profile module.
Located in: Website/DesktopModules/Admin/ViewProfile/ViewProfile.ascx

Class Declaration


Partial Class ViewProfile
Inherits ProfileModuleUserControlBase

Implementation


Public Overrides ReadOnly Property DisplayModule() As Boolean
Get
Return True
End Get
End Property

Example Code (C#)

Example code taken from core's User Profile module.
Located in: Website/DesktopModules/Admin/ViewProfile/ViewProfile.ascx of C# project (currently not supported).

Class Declaration


partial class ViewProfile : ProfileModuleUserControlBase

Implementation


public override bool DisplayModule
{
get { return true; }
}

Contents
No sections defined
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out