WebPart 之间互相通信详细过程

由于最近几个月,一直关注在c#方面,一直在接触moss方面的项目,在项目中突然遇到有需要同一页面上n多webpart,要通信。找了好多的网址也没一个描述的比较具体的。下面自己摸索具体的使用方法(总体上和网页上说的是一致的。):

 

1. customize a connection interface:

ForExample:

using System;

using System.Collections.Generic;

using System.Text;

namespace MyNameSpace

{

public interface IParameterConnection

{

    Parameter ProviderParameter { get; }

}

}

 

2. the provider class must be implement the interface and implement the following code

FE:

[ConnectionProvider("Parameter Provider")]//very important

public IParameterConnection ConnectionInterface()

{

return this;

}

public Parameter ProviderParameter

{

get { return p; }

}

note: you can customize your parameter structor in Parameter class. and set the value in provider class.

 

3.the consumer class must be implement the following code

FE:

IParameterConnection m_providerPart = null;

[ConnectionConsumer("Parameter Consumer")]//very important

public void GetConnectionInterface(IParameterConnection providerPart)

{

m_providerPart = providerPart;

}

 

note: if you  receive the providerPart, you will get the parameter from the m_providerPart and do what you wanna do;

 

4.in your provider webpart, please click "Modify Shared Web Part", in edit mode, hit the edit menu. within it, set the consumer webpart. please follow the above steps, set the consumer's provider web part.

 

5. if you finish the above steps, the provider-consumer mode will be work fine.

 

下篇我将会记录自己在MOSS方面集成BI方面的感触。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值