Home » DotNetNuke - Module Development » DotNetNuke Modules – PortalModuleBase

DotNetNuke Modules – PortalModuleBase

F03I0037 We’ve been through most of the basics now with respect to creating the View module of the DotNetNuke module set.  We will be moving on to the Settings module next.  But before we do, we need to review a few important properties and methods of the PortalModuleBase class that the view module inherits from.

This list will not be a complete list, but it will cover the most important APIs for this class.

LocalResourceFileThis property returns the location of the resource file associated with this control.  Used in conjunction with internationalization.  We’ve already used this property in our previous example showing how to add actions.
ModuleIdEach instance of the module gets a unique ID.  This property is that ID.  You should use this to access data that is instance specific.
ModulePathThe root relative path to the location of the module.  This does not include the file name.  If you want the location of the file on the hard drive, you’ll need to use Server.MapPath() to convert it.
PortalAliasHolds the alias string used to access the site, the PortalId, and the alias ID.
PortalIDEach portal gets its own ID.  In one application I wrote, I wanted every instance of the module to grab data from the same pool of data so I needed to use the PortalID as the unique identifier rather than the moduleID as is the recommended way.  You may have your own uses for this information.
PortalSettingsHolds lots of information about the portal, most of which is set in site settings using the administrator account.
TabIDTells you what page the module is located on.
UserIDUniquely identifies the logged-in user.  If the value is -1, the user is not logged in.
UserInfoGives you more specific information about the user, including:
– UserName
– FirstName
– LastName
– Roles


Other post in DotNetNuke - Module Development

Related Post

  • DotNetNuke Modules – Creating Base ModulesDotNetNuke Modules – Creating Base Modules Now that we have DotNetNuke installed into Visual Studio we can go ahead and create our first modules. Actually, creating the modules is pretty simple. But it is even easier to do it […]
  • DotNetNuke Modules – Module SettingsDotNetNuke Modules – Module Settings Since each instance of a module that we put on a page should be able to have it's own configuration information, it is necessary to have some place that will allow us to configure […]
  • DotNetNuke Modules – Anatomy of the ViewDotNetNuke Modules – Anatomy of the View Now that we've laid the foundation of DotNetNuke modules, it is time to start looking at the specific modules. While it would be practically impossible to cover every detail and every API […]
  • DotNetNuke Modules – Labels w/ no HelpDotNetNuke Modules – Labels w/ no Help While the bulk of the labels you use on a module will be DotNetNuke labels, occasionally you want to be able to put text on the screen that doesn't need context help and doesn't need to be […]
  • DotNetNuke Modules – Where Stuff Shows UpDotNetNuke Modules – Where Stuff Shows Up We continue our series on creating DotNetNuke modules today by showing you where the various components of the module we created last week show up in DotNetNuke.Remember, last […]

About Dave Bush

Dave Bush is a Full Stack ASP.NET developer. His commitment to quality through test driven development, vast knowledge of C#, HTML, CSS and JavaScript as well as his ability to mentor younger programmers and his passion for Agile/Scrum as defined by the Agile Manifesto and the Scrum Alliance will certainly be an asset to your organization.