dnn中模块间的通讯机制

做个简单的记录:

1.发送页面:

继承DotNetNuke.Entities.Modules.Communications.IModuleCommunicator
public event ModuleCommunicationEventHandler ModuleCommunication;

 ModuleCommunicationEventArgs oArgs = new ModuleCommunicationEventArgs();
oArgs.Text 
= rootId;    //传递值
oArgs.Sender 
= "Sender";
oArgs.Target 
= "me";  //传递标志
if (ModuleCommunication != null)
    ModuleCommunication(
this, oArgs);

2.接收页面:
继承 DotNetNuke.Entities.Modules.Communications.IModuleListener
 public void OnModuleCommunication(object s, ModuleCommunicationEventArgs e)
{
    
if (e.Target == "me")
    {
        
//接收变化
       Response.Write(e.Text);
     }
}

“光棍节快乐”! 呵呵。。。。

posted @ 2007-11-11 13:43  LeoXu  阅读(323)  评论(0编辑  收藏  举报
阿里云服务器购买页