WebPartConnection.WebPartConnection Constructor

Initializes a new instance of the WebPartConnection class.

Namespace: System.Web.UI.WebControls.WebParts
Assembly: System.Web (in system.web.dll)

public:
WebPartConnection ()
public WebPartConnection ()
public function WebPartConnection ()
Not applicable.

The WebPartConnection constructor is public so that the ASP.NET parser can create an instance when a connection is declared in the markup of a Web page; this constructor is not intended to be used in developer code.

When you want to create a WebPartConnection object programmatically, you should use the WebPartManager.ConnectWebParts or the WebPartManager.ConnectWebParts method provided in the WebPartManager control. These methods handle the many details of creating a connection, and return a WebPartConnection object.

The WebPartConnection constructor for the WebPartConnection class sets the values of the IsShared and IsStatic properties to true. Thus the default state of a new connection is to be static (meaning that it is declared in the markup of the containing Web page) and shared (visible to all users of the page). This will be the case when you add a connection in the typical scenario, by declaring the connection in the markup of the page with an <asp:webpartconnection> element. However, in other circumstances a connection will have different values for these properties. For example, when you add a connection programmatically by creating the connection object in code, and the user is viewing the page in the default user personalization scope, the connection is created as a dynamic, per-user(visible only to the specific user) connection.

NoteNote:

The IsShared and IsStatic properties are read-only, and these properties that determine the nature of a connection are set internally by the WebPartManager control depending on how a connection is created (declaratively in the page markup, or programmatically through your code or the user interface).

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show: