StaticConnections Property

ProxyWebPartManager.StaticConnections Property


Gets a collection of static connections declared within the <asp:proxywebpartmanager> element on a content page.

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

public ProxyWebPartConnectionCollection StaticConnections { get; }

Property Value

Type: System.Web.UI.WebControls.WebParts.ProxyWebPartConnectionCollection

A ProxyWebPartConnectionCollection that contains all static WebPartConnection objects declared within an <asp:proxywebpartmanager> element.

The StaticConnections property references the collection of WebPartConnection objects declared in an <asp:proxywebpartmanager> element. The connections contained in this collection are added to the static connections of the WebPartManager controls (referenced by its WebPartManager.StaticConnections collection), and treated exactly like any other connections associated with the WebPartManager control.

The declarative element that corresponds to the StaticConnections property is the <staticconnections> element. In an application that uses master pages, the <staticconnections> element is added as a child of the <asp:proxywebpartmanager> element on a content page, and an <asp:webpartconnection> element in turn is added as a child of the <staticconnections> element. Multiple <asp:webpartconnection> elements can be added to one <staticconnections> element, and multiple content pages can declare static connections as part of a master pages application.

The following code example demonstrates how to use the StaticConnections property on the ProxyWebPartManager class. This code example shows only the relevant portion of the code from the content page that declares the ProxyWebPartManager control and the static connection. For the other pages required to run the code example, and a description of how to set them up, see the Example section of the ProxyWebPartManager class overview.

The following code is the content page that declares the <staticconnections> element as a child of the <asp:proxywebpartmanager> element. Also note that the Button1_Click method checks the count of the StaticConnections property on the ProxyWebPartManager control and writes it to the page.

After you load the page in a browser, click the WebPartManager Information button and observe the information about the WebPartManager control in the master page, and the ProxyWebPartManager control in the content page. For example, note that they both have the same count in their respective properties that track static connections (the StaticConnections property).

.NET Framework
Available since 2.0
Return to top
© 2015 Microsoft