ConnectionsZone::ConnectVerb Property
Gets a reference to a WebPartVerb object that enables two WebPart controls to establish a connection.
Assembly: System.Web (in System.Web.dll)
[PersistenceModeAttribute(PersistenceMode::InnerProperty)] public: virtual property WebPartVerb^ ConnectVerb { WebPartVerb^ get (); }
Property Value
Type: System.Web.UI.WebControls.WebParts::WebPartVerbA WebPartVerb that enables two controls to establish a connection.
The connect verb, as used with a ConnectionsZone control, is a zone-level verb that appears in the connection user interface (UI) as part of the view in which users finalize a connection between two controls. In the part of the UI where users can select connection points, if two controls are able to connect, the connect verb is enabled near the bottom of the UI. After users select a connection point, they can click the connect verb to create the connection.
Note: |
|---|
The zone-level connect verb discussed in this topic actually establishes a connection between controls, and is different from the verb that appears on the verbs menu of a WebPart control. When a user switches a Web page to connect display mode, if a control can form connections, a WebPart connect verb appears on its verbs menu. This WebPart connect verb simply opens the connection UI created by the ConnectionsZone control. In contrast, the ConnectVerb verb discussed in this topic, which operates at the zone level, actually creates a connection. |
Use the ConnectVerb property to get a reference to the corresponding WebPartVerb object in the UI. Although the property itself is read-only, after you have a reference to the verb, you can change its property values as needed.
You can set the property values of the connect verb declaratively, by declaring the <connectverb> element between the opening and closing tags of an <asp:connectionszone> element. The properties of the verb can also be set declaratively within the opening tag of the <asp:connectionszone> element, by adding an attribute in the form Property-Subproperty, where Subproperty is a property of the WebPartVerb object (for example, ConnectVerb-Text). You can also set the properties programmatically in the form Property.Subproperty (for example, ConnectVerb.Text).
The following code example demonstrates the use of the ConnectVerb property with a ConnectionsZone control. The example contains only the code for the Web page that demonstrates use of the property; for the other two code files needed to run the example, see the Example section of the ConnectionsZone class overview. The code example has four parts:
A user control that enables you to switch display modes on the Web page. Obtain this code from the ConnectionsZone class overview.
A source file that contains the code for a ZIP Code interface, and two WebPart controls acting as the provider and the consumer for a connection. Obtain this code from the ConnectionsZone class overview.
A Web page that hosts all the controls, declares an <asp:connectionszone> element, and shows how to use the property declaratively and programmatically.
An explanation of how the example works in a browser.
The Web page declares an <asp:connectionszone> element and, within the element tags, it declares a <connectverb> element and sets some properties using attributes. Also, in the Page_PreRender method, the code sets some properties on the connect verb for the ConnectionsZone control.
Load the page in a browser. Switch to connect mode, using the Display Mode control. Click the verbs menu arrow on the ZIP Code Provider control, and click the connect verb. Click the End Connection button to disconnect the controls that are already connected due to the declarative connection on the page. Click the Select a consumer for the provider to connect with hyperlink, and notice the effect of setting the various properties. If you position your mouse pointer over the Connect Controls button, the custom description text appears in a ToolTip.
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Note: