Partager via


RegisterInterface(String, String, Int32, Microsoft.SharePoint.WebPartPages.Communication.ConnectionRunAt, object, String, String, String, Boolean) Method

The RegisterInterface method of the WebPart class registers an interface from the Microsoft.SharePoint.WebPartPages.Communication Namespace for a connectable Web Part.

Parameters

interfaceName   The friendly name of the interface.

interfaceType   The type of the interface as listed in the fields of the InterfaceTypes class.

maxConnections   Specifies the limit on the number of connections to this interface. Can be either WebPart.LimitOneConnection or WebPart.UnlimitedConnections.

runAtOptions   A Connection.RunAt that specifies where the interface can be run.

interfaceObject   A reference to the implemented interface.

interfaceClientReference   The string used reference the interface in script for client-side connections, for example "RowProviderInterface_WPQ_".

menuLabel   The label that will be used in the user interface for creating a Web Part connection with this interface.

description   A brief description of the interface that will be used in the user interface for creating a Web Part connection with this interface.

allowCrossPageConnection   Specifies if this connection interface is exposed in the user interface of authoring environments for creating a connection across two Web Part pages. If the value is set to true, this connection interface will be exposed in the authoring environment for creating cross-page connections within the limitations of the connection compatibility rules defined by the Web Part infrastructure. If the value is set to false, the interface will not be made available for authoring cross-page connections.

Remarks

When developing a connectable Web Part, you should call this method once for each interface in the EnsureInterfaces method for the Web Part.

Note  This method is one of two overloaded RegisterInterface methods. The other method, RegisterInterface(String, String, Int32, Microsoft.SharePoint.WebPartPages.Communication.ConnectionRunAt, object, String, String, String) does not include the allowCrossPageConnection parameter in its function signature, and hard codes this setting to default values.

Example

For a code example that calls the RegisterInterfaceMethod, see RegisterInterface(String, String, Int32, Microsoft.SharePoint.WebPartPages.Communication.ConnectionRunAt, object, String, String, String). For an overview of the steps of creating a connectable Web Part, see Creating a Connectable Web Part.

Requirements

Platforms: Windows Server 2003

Security: Code Access Security The WebPartPermissions.Connections permission is required to use this member.