Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

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!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Which API I should use to get Module IDWhich API I should use to get Module ID
Previous
 
Next
New Post
7/19/2007 11:05 PM
 

I want to get another Module's "Module ID" using code. Which API I should use? And what is the Namespace?  Thanks in advance.

George

 
New Post
7/20/2007 1:41 PM
 

Can you describe your use case a little more? 

  • What are you really trying to accomplish?
  • Are the modules on the same page?
  • Is either module a core module or both custom?
  • Are you using IMC?
 
New Post
7/21/2007 9:45 AM
 

Dear professorcw1,

The other module is custom too. And is not on the same page with mine. I am not using IMC, because I have no control to the other module.

I am developing a module in which I need to pull some data out from the other module's database tables.

Thank you very much for your time,

George

 
New Post
7/23/2007 9:09 AM
 

So if both modules are custom, I'll presume you are writing them both.  You have a couple of options.  The most important thing is you need to get the tabid that holds the module you are looking for.  You may know the tabid, but you probably only know the tab name.  If that's the case, you can get the tabid of the remote module by using:

Dim ctlTabs As New DotNetNuke.Entities.Tabs.TabController
Dim objTabs As DotNetNuke.Entities.Tabs.TabInfo = ctlTabs.GetTabByName("TabName", PortalId)

Dim RemoteTabID = objTabs.TabID

'Get ArrayList of Modules on that tab
Dim aryRemoteModules = objTabs.Modules

I don't know if you need that arraylist of the modules on your remote tab, but in case you can use it, I thought you'd like to know it's there.  Regardless, the next thing you want to get is the modules on that tab.  You can do it in many ways.  If it were me, I would probably write something in my module that does the look up.  You should know the module definition id of the remote module, but again, if necessary, you can look that up as well.

Ulimately, you're going to end up with a stored procedure that does something like:

SELECT
     'remotemoduleid' = m.ModuleID
FROM Modules M
JOIN TabModules T ON t.ModuleID = m.ModuleID
WHERE M.ModuleDefID = @moduledefid
AND t.TabID = @tabid

The only thing I'm concerned about with that procedure is you will need to account for the possibility of having more than one instance of your remote module on the remote page.  LMK if that helps.

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Which API I should use to get Module IDWhich API I should use to get Module ID


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out