Blog

Most Recent Blog Entries

Oct 29

Written by: Brian Dukes
10/29/2008 2:42 PM 

When building DotNetNuke modules, a number of times I've run up against the issue of trying to instantiate a ModuleInfo instance with only a module ID.  However, the GetModule signature on ModuleController takes both a module ID and a tab ID.  In this latest instance where I've come against this issue, I was actually trying to get a tab ID based on the module ID, so I obviously didn't already had one to provide. 

As I started to move down the road of writing my own query to get this simple thing done, I found that the GetModule method and underlying query will take a "null" value for the tab ID!  Unbeknownst to me, the solution was right in front of me, right where I expected it to be the whole time, I just couldn't see it.

So, if you need a ModuleInfo instance and you only have a module ID, call GetModule(moduleId, Null.NullInteger) and you're good to go!

(I've put in a request with the people in charge to add an overload to GetModule so that this is more obvious going forward)

[Cross posted from http://weblogs.asp.net/briandukes/archive/2008/10/29/get-module-by-moduleid.aspx]

Tags:

Your name:
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Add Comment   Cancel 

Purchase

Please click here to buy now.
Payment will be processed via credit card or PayPal.

Test Drive!

Want to find out how it works? Visit our demo site to see the modules in actions!

Subscribe

Sign up for our newsletter and get the latest product updates!

Online Support

Powered by DotNetNuke