Simple as i could make that seamlessly tough concept about dotnetnuke.
i simply made two dotnetnuke modules 1 to send message to other
module (receiver). simply implement two dotnetnuke
ready made
interfaces and sender raise event and send data in object through
eventarguments and receiver get that data through
that raised event.
i think enough talks lets code sorry for stupid formatting
Sender Steps with example code:
implement class by IModuleCommunicator like below{
Implements Entities.Modules.Communications.IModuleCommunicator}
Create controls and Add like below{
Me.txtMsg1.Text = “Message 2 Send”
Me.btnSend1.Text = “Send”
Me.Controls.Add(txtMsg1)
Me.Controls.Add(btnSend1)}
Declare Event and make created controls eventable{
Public Event ModuleCommunication(ByVal sender As Object, ByVal e As
DotNetNuke.Entities.Modules.Communications.ModuleCommunicationEventArgs)
Implements DotNetNuke.Entities.Modules.Communications.IModuleCommunicator.ModuleCommunication
Protected WithEvents txtMsg1 As New System.Web.UI.WebControls.TextBox
Protected WithEvents btnSend1 As New System.Web.UI.WebControls.Button
}
Declare event arguments and raise event like below in btnSend click event{
Dim objEventArgs As New DotNetNuke.Entities.Modules.Communications.
ModuleCommunicationEventArgs(”IMCSender”, Me.txtMsg1.Text,
GetType(ViewIMCSender).Name, “ViewIMCSReceiver”) RaiseEvent ModuleCommunication(Me, objEventArgs)}
Receiver Steps with example code:
Implement class by IModuleListener like below{
Implements DotNetNuke.Entities.Modules.Communications.IModuleListener}
Implement OnModuleCommunication like below{
Select Case e.Type
Case “IMCSender”
If e.Sender = “ViewIMCSender” And e.Target = GetType(YourCompany.Modules.IMCSReceiver.ViewIMCSReceiver).Name Then
lblReceive.Text = e.Value.ToString()
End If End Select }