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