Share via


Web Part Connections

The Web Part infrastructure provides a standardized set of interfaces called connection interfaces that allow Web Parts to exchange information with each other at run time. For example, the List View Web Part that is integrated into Microsoft® Office SharePoint™ Portal Server 2003 can provide (send) a row of data to any other Web Part that can consume (receive) that row, such as a Web Part that implements a form to display the row.

Because the Web Part infrastructure provides a standard set of connection interfaces, connectable Web Parts can be developed by entirely different developers or companies to communicate with one another. A part that supports connection interfaces can be connected by an end user using either Microsoft Office FrontPage® or a Web browser, allowing end users to build sophisticated combinations of Web Parts through a simple menu-driven user interface.

In the Web Part-to-Web Part communication model, events are handled not by the page or even by the Web Part zone that contains the Web Part, but by handlers in other Web Parts on the page. Web Parts do not have hard-coded knowledge about which other Web Parts they are communicating with since connections between Web Parts are created on the fly by users at run time.

The Web Part connections infrastructure mediates communication between Web Parts by calling standard methods of the WebPart base class for each connected Web Part on a page to discover the connectable Web Parts. To make connection options available to the user, it populates menus that are added to each connectable Web Part.

Most of the connection interfaces require you to declare event delegates. The Web Part infrastructure hooks these events to handlers in other Web Parts when a user creates a connection. The infrastructure calls a series of methods for each connectable Web Part while the page is being constructed so the Web Parts can communicate with each other by firing events that are handled by the Web Parts they are connected to.

For more information about creating Web Part connections, see Web Part Connections. For an example of how to create a connectable Web Part, see Creating a Connectable Web Part.