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.0How to Comminicate between module(Donot Using QueryString)How to Comminicate between module(Donot Using QueryString)
Previous
 
Next
New Post
4/21/2008 4:45 AM
 

Hello,

Im developing dnn module it easy and powerfull.thx to DNN for prividing such a good framework ..

but i have some problem(misunderstanding)..if a i have two module Like one category and one list ( newslist  or whatever else) i want to know how to comminicate between two module in one Tab., like this sample u have some Category Module that list the category list (Or Tree ) and when user click on the category the other Module for examle News Module list the related category News. Now I Handle this by passing the category code by query string ..but i dont like that ..is there  any other solution like forcing the engine load the news list  again with new parameter (here selected category id)..

Thanx Alot

 
New Post
4/21/2008 7:01 AM
 

Yes, if the modules are on the same page, you can use InterModule Communication

First, both modules must implement the IModuleCommunicator interface

Implements Entities.Modules.Communications.IModuleCommunicator

Public Event ModuleCommunication(ByVal sender As Object, ByVal e As
DotNetNuke.Entities.Modules.Communications.ModuleCommunicationEventArgs) Implements
DotNetNuke.Entities.Modules.Communications.IModuleCommunicator.ModuleCommunication 

Then in the module that will be 'sending' a message you raise a message like this...

Dim moduleCommunicationEventArgs As _
   New DotNetNuke.Entities.Modules.Communications.ModuleCommunicationEventArgs
' name of the sending module
moduleCommunicationEventArgs.Sender = "CategoryModule"
' Module ID of the module to send the message To
moduleCommunicationEventArgs.Target = 999 
' parameter you want to pass
moduleCommunicationEventArgs.Value = SelectedCategory.Value  
' event name
moduleCommunicationEventArgs.Type = "CategoryClicked" 
' send the message
RaiseEvent ModuleCommunication(Me, moduleCommunicationEventArgs)

 Then in your 'listener' module, add code to respond to an event

Public Sub OnModuleCommunication(ByVal s As Object, ByVal e As 
    DotNetNuke.Entities.Modules.Communications.ModuleCommunicationEventArgs) Implements 
    DotNetNuke.Entities.Modules.Communications.IModuleListener.OnModuleCommunication

   If e.Sender = "CategoryModule" Then        ' check to see who the message is from
       If CInt(e.Target) = Me.ModuleId Then   ' make sure the message is intended for this module
           IF e.Type = "CategoryClicked"      ' check the message type being sent
               Dim dCategoryId = e.Value      ' get the category id
               ' do something like rebind a list
           End If
       End If
   End If

End Sub

 
New Post
4/21/2008 12:00 PM
 

How about using Session objects?

 
New Post
3/26/2009 4:40 PM
 

 Steve -

It is my understanding that the 'listening' module needs to implement the IModuleListener interface, NOT the IModuleCommunicator interface...

Just wanted to clear that up.

 
New Post
3/26/2009 5:03 PM
 

Arun wrote
 

How about using Session objects?

Arun-
When modules are on different pages I believe Session Object use works perfectly fine for simple communication.   The practice is, however, sometimes frowned upon due to misuse.  A common misuse is to rely on the SO as a temporary store for mass amounts of data (XML-based recordsets, for instance).  Another misuse would be a lack of proper housekeeping for that "temporary" data hangs around longer than intended (i.e., lack of state maintenance for data).  
 
The old standby of server-side data storage + state maintenance is the most secure and reliable way to communicate between modules if the modules do not appear on the same page.  Of course, this usually also requires the most development work...
 
-mamlin


esmamlin atxgeek.me
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0How to Comminicate between module(Donot Using QueryString)How to Comminicate between module(Donot Using QueryString)


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