SPWebPartManager.SPConnectWebParts method (WebPart, ProviderConnectionPoint, WebPart, ConsumerConnectionPoint)
建立與指定的 Web 組件的參考的兩個 Web 組件和指定的ConnectionPoint物件之間的SPWebPartConnection 。
Namespace: Microsoft.SharePoint.WebPartPages
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'宣告
Public Function SPConnectWebParts ( _
provider As WebPart, _
providerConnectionPoint As ProviderConnectionPoint, _
consumer As WebPart, _
consumerConnectionPoint As ConsumerConnectionPoint _
) As SPWebPartConnection
'用途
Dim instance As SPWebPartManager
Dim provider As WebPart
Dim providerConnectionPoint As ProviderConnectionPoint
Dim consumer As WebPart
Dim consumerConnectionPoint As ConsumerConnectionPoint
Dim returnValue As SPWebPartConnection
returnValue = instance.SPConnectWebParts(provider, _
providerConnectionPoint, consumer, _
consumerConnectionPoint)
public SPWebPartConnection SPConnectWebParts(
WebPart provider,
ProviderConnectionPoint providerConnectionPoint,
WebPart consumer,
ConsumerConnectionPoint consumerConnectionPoint
)
參數
provider
Type: System.Web.UI.WebControls.WebParts.WebPart提供資料給consumer ,當控制項已連接 「 網頁組件。
providerConnectionPoint
Type: System.Web.UI.WebControls.WebParts.ProviderConnectionPoint做為回呼方法,使provider可以參與連接的連接點。
consumer
Type: System.Web.UI.WebControls.WebParts.WebPart從provider接收資料,當控制項已連接 「 網頁組件。
consumerConnectionPoint
Type: System.Web.UI.WebControls.WebParts.ConsumerConnectionPoint做為回呼方法,使consumer可以參與連接的連接點。
傳回值
Type: Microsoft.SharePoint.WebPartPages.SPWebPartConnection
兩個 Web 組件之間的連線。
Exceptions
Exception | Condition |
---|---|
WebPartPageUserException |
|
InvalidOperationException | 提供者或消費者 Web 組件不在區域中。 |
備註
這個多載用來連接 Web 組件,當其連接點會完全相容它們可以連線而不使用WebPartTransformer物件。