ProfileModuleUserControlBase

Return to previous page

  • 4/7/2015
  • 641 Views

Comments

641 Views

ProfileModuleUserControlBase

Last updated 6 years 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

DNN Digest is our monthly email newsletter. It highlights news and content from around the DNN ecosystem, such as new modules and themes, messages from leadership, blog posts and notable tweets. Keep your finger on the pulse of the ecosystem by subscribing.  


Copyright 2017 by DNN Corp Terms of Use Privacy
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out