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.0Make connection between modulesMake connection between modules
Previous
 
Next
New Post
11/2/2007 3:44 PM
 

Hi all,

I want to know how can I make connection between dotnetnuke modules. I want to click on a link in a module and then 1) Refresh or 2)run javascript function or 3)run a code behind in another module.

best regards

 
New Post
11/2/2007 4:04 PM
 

There is a Module Communication interface built into the framework.  Either google or search the forums for InterModuleCommunication or Module Communication.  There are several posts on this on the internet and in the forums.  If you search the forums, make sure you set your date range pretty wide.

Wallew

 
New Post
11/2/2007 10:53 PM
 

POSTED THIS RECENTLY in relation to another question - but it counts pretty much the same for yourself.

In your first module - the one with the links you need to implement IMouduleCommunicator

Partial Class YOUR_COMMUNICATOR_MODULE
     Inherits PortalModuleBase
     Implements Entities.Modules.Communications.IModuleCommunicatorPublic Event ModuleCommunication(ByVal sender As Object, ByVal e As DotNetNuke.Entities.Modules.Communications.ModuleCommunicationEventArgs)  _Implements DotNetNuke.Entities.Modules.Communications.IModuleCommunicator.ModuleCommunication

 >>>>>>>>>>>>>>>>>>>

 Then in the callback code for your links you need to raise a module communicator event

     Dim objModuleCommunicationEventArgs As New DotNetNuke.Entities.Modules.Communications.ModuleCommunicationEventArgs("EventType", "EventValue", "yourSENDER", "yourTARGET")
    RaiseEvent ModuleCommunication(Me, objModuleCommunicationEventArgs)

Set the eventtype and eventvalue to whatever you want -  the eventvalue would contain the info needed by the listening module to workout what action it should perform.

You could also use eventtype to granularize the events into categories if there are a lot of them.
 
NOTE: the sender and target can also be set if you want to make sure you are only handling events your module can process - note though that this checking is not automatic - all listeners in all modules on the current page receive all events - you need to do the checking in your code to be sure

>>>>>>>>>>>>>>>

Next in your LISTENER module - the one where you want to control actions -  you implement IModuleListener

Partial Class YOUR_LISTENER_MODULE
     Inherits PortalModuleBase
     Implements DotNetNuke.Entities.Modules.Communications.IModuleListener AND create listener event subroutine

Public Sub OnModuleCommunication(ByVal s As Object, ByVal e As DotNetNuke.Entities.Modules.Communications.ModuleCommunicationEventArgs) Implements DotNetNuke.Entities.Modules.Communications.IModuleListener.OnModuleCommunication  Select Case e.Type
    Case "yourEventType"
      If e.Sender = "yourSENDER" And e.Target = "yourTARGET" Then

        ' PERFORM WHATEVER ACTION YOU NEED HERE
        ' IN THIS CASE - YOU WOULD CALL SUBROUTINE THAT CAUSES A MODULE TO LOAD BASED ON e.Value
        
        Dim myReturn As Integer = doACTION( e.Value )

        ' NOTE - YOU WOULD ALSO NEED TO STORE THE VALUE IN SOME SORT OF STATEFUL STORAGE LIKE THE CACHE,
        ' SINCE ANY SORT OF CALLBACK EVENT ON THE DYNAMIC MODULE WOULD FORCE A PAGE RELOAD AND THE CURRENT 
        ' DYNAMIC MODULE WOULD BE LOST

      End If

  End
Select

End
Sub 

 

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Make connection between modulesMake connection between modules


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