ConnectionsZone.CloseVerb Property
Assembly: System.Web (in system.web.dll)
The close verb, as used with a ConnectionsZone control, is a zone-level verb that appears at the bottom (the footer) of the connection UI. When users click the close verb, it cancels the connection process and closes the connection UI, but leaves the page in connect display mode. At this point, the user can either return the page to browse mode or click the connect verb on another server control to reopen the connection UI.
The close verb should be distinguished from the header close verb (for details, see the HeaderCloseVerb property). Both verbs perform the identical action of closing the connection UI, but the header close verb appears at the top of the UI and is represented by a hyperlink by default, whereas the close verb appears at the bottom of the UI, and is represented by a button by default.
Use the CloseVerb 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 close verb declaratively, by declaring the <closeverb> element within the tags of an <asp:connectionszone> element. The properties of the verb can be set declaratively in the form Property-Subproperty, where Subproperty is a property of the WebPartVerb object (for example, CloseVerb-Text). You can also set the properties programmatically in the form Property.Subproperty (for example, CloseVerb.Text).
The following code example demonstrates the use of the CloseVerb 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, it declares a <closeverb> element and sets a property using attributes. Also, in the Page_PreRender method, the code sets a property on the close 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 Close Zone button at the bottom of the connection UI, the custom description text appears in a ToolTip. Notice that the header close verb at the top of the connections zone is represented by a hyperlink, and your property assignments on the close verb have no effect on the header close verb.
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.