DotNetNuke Daily Tip #9 7/18/06 Skin Object Using PortalModuleBase

DotNetNuke Daily Tip #9 7/18/06 Skin Object Using PortalModuleBase

After a long haitus over the past few weeks the dotnetnuke Daily Tips are back!

Sometimes you want to put a skinobject in your DotNetNuke Skins that you need to act like a module. Inheriting from PortalModuleBase instead of SkinObjectBase. SkinObjects though don't get loaded like regular modules and due to that you may run into issues where you can't easily access the TabId of the existing page. Here's how to get that information easily.

Dim objPortalModule As PortalModuleBase = DotNetNuke.UI.Containers.Container.GetPortalModuleBase(Me)
thisTabId = objPortalModule.TabId

Put the above code in your skinobject code and you will now have a PortalModuleBase object that you can use to easily access some of the basic DNN properties you're used to using from PortalModuleBase.

The above is VB code, any self respecting C# developer should be able to figure out the appropriate C# code. If not, email me and I'll bill you at my hourly rate ;)


Stay tuned for another coming tomorrow!

Posted from weblogs.asp.net/christoc

Recent Comments

There are currently no comments. Be the first to make a comment.

Add Comment

Please add your comment by filling out the field(s) below. Your comment may need to be approved before it becomes visible.
Enter your first name for display with the comment
Enter your last name for display with the comment.
Enter your comment here.
If you can't type DNNRocks in, you can't post, plain and simple.
Submit Comment Cancel

Chris Hammond

Chris Hammond is a father, husband, leader, software developer, photographer and car guy. Chris focuses on the latest in technology including artificial intelligence (AI) and has spent decades becoming an expert in ASP.NET and DotNetNuke (DNN) development. You will find a variety of posts relating to those topics here on the website. For more information check out the about Chris Hammond page.

Find me on Twitter, GitHub and LinkedIn.