Export (0) Print
Expand All

WebPartConnection.IsStatic Property

Gets a value that indicates whether a WebPartConnection object is declared in the markup of a Web page, or created programmatically.

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

[<BrowsableAttribute(false)>]
member IsStatic : bool with get

Property Value

Type: System.Boolean
true if the connection is static; otherwise, false.

Connections between Web Parts controls can be either static or dynamic. A static connection is declared in the markup of a Web page, using an <asp:WebPartConnection> element. Dynamic connections are created programmatically or when a user creates a connection through the user interface (UI) defined by the ConnectionsZone control.

Static connections are shared objects, meaning they are available to all users of the Web page. Also, they are essentially permanent because, like a static WebPart control, they cannot be permanently deleted.

NoteNote

While a static connection object cannot be permanently deleted, it can be permanently disconnected. In this case, the disconnected object would exist on the server, but an end user would never be aware of the object's existence in a page.

The following code example demonstrates the programmatic use of the IsStatic property.

The code example has three parts:

  • Source code for an interface and two WebPart controls acting as the provider and the consumer for a connection.

  • A Web page to host the controls and run the code example.

  • An explanation of how to run the example page.

The first part of the code example is the source code for the interface, and the consumer and provider controls. For the code example to run, you must compile this source code. You can compile it explicitly and put the resulting assembly in your Web site's Bin folder or the global assembly cache. Alternatively, you can put the source code in your site's App_Code folder, where it will be dynamically compiled at run time. This code example uses dynamic compilation. For a walkthrough that demonstrates how to compile, see Walkthrough: Developing and Using a Custom Web Server Control.

No code example is currently available or this language may not be supported.

The second part of the code example is the Web page. Near the top is a Register directive that refers to the source code for the two dynamically compiled WebPart controls. The static connection is declared within the <StaticConnections> element on the page. The Button1_Click method accesses the IsStatic property to check whether the connection is static.

No code example is currently available or this language may not be supported.

Load the page in a browser. The static connection is already created. Enter some text in the provider control, and note that the text is displayed in the consumer control. Click the Connection Details button to display the value of the IsStatic property.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft