ConnectionsZone::DisconnectVerb Property
Gets a reference to a WebPartVerb object that enables a user to disconnect two connected WebPart controls.
Assembly: System.Web (in System.Web.dll)
public: [PersistenceModeAttribute(PersistenceMode::InnerProperty)] property WebPartVerb^ DisconnectVerb { virtual WebPartVerb^ get(); }
Property Value
Type: System.Web.UI.WebControls.WebParts::WebPartVerb^A WebPartVerb that disconnects two connected WebPart controls.
The disconnect 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 manage an existing connection between two controls. After users have clicked the WebPart connect verb on the verbs menu of a control, and the connection UI appears, if there is already a connection between two controls, the disconnect verb appears activated near the bottom of the UI.
Use the DisconnectVerb 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 disconnect verb declaratively, by declaring the <disconnectverb> 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, DisconnectVerb-Text). You can also set the properties programmatically in the form Property.Subproperty (for example, DisconnectVerb.Text).
The following code example demonstrates the use of the DisconnectVerb 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, declares a <disconnectverb> element and sets some properties using attributes. Also, in the Page_PreRender method, the code sets some properties on the disconnect 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. Note the effect of the property values that were set on the disconnect verb. If you position your mouse pointer over the End Connection button, the custom description text appears in a ToolTip. Click the End Connection button to disconnect the controls that are already connected due to the declarative connection on the page.
Available since 2.0