WebPartZoneBase.HelpVerb Property

 

Gets a reference to a WebPartVerb object used to access Help content for WebPart controls in a zone.

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

[<PersistenceModeAttribute(PersistenceMode.InnerProperty)>]
abstract HelpVerb : WebPartVerb with get
[<PersistenceModeAttribute(PersistenceMode.InnerProperty)>]
override HelpVerb : WebPartVerb with get

Property Value

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

A WebPartVerb that enables users to access Help content on the WebPart controls in a zone.

The HelpVerb property can be accessed either declaratively or programmatically. You can access it declaratively within a zone by using the <asp:HelpVerb> element to set the text, the description, whether the verb is enabled, and other attributes. It is not necessary to declare a help verb for a zone, however, because it is enabled by default. The only step that is necessary to enable a help verb to appear on the verbs menu of WebPart controls in a zone at run time is to assign a value to the HelpUrl property for individual WebPart controls.

The following code example demonstrates the use of the HelpVerb property on a WebPartZone control.

For the code example to work, in addition to the following code, you need a custom WebPart control. You can either use your own control, or use the code for the custom TextDisplayWebPart control found in the Example section of the WebPart class overview.

This code example includes a user control to enable you to change display modes on a Web page. For more information about display modes and the source code in this control, see Walkthrough: Changing Display Modes on a Web Parts Page.

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

This code example also includes an HTML page that could contain Help content for the TextDisplayWebPart control. For this example to work, you must save the following code in a file named Textwebparthelp.htm and place it in the same directory of your site as the .aspx page that hosts the TextDisplayWebPart control.

<html>
<head runat="server">
    <title>Text Content WebPart Help</title>
</head>
<body>
  <div>
  <h1>Text Content WebPart Help</h1>
  To make the WebPart control work...
  </div>
</body>
</html>

The code example also includes the following partial class that contains the code to handle the events in the .aspx page.

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

The other part of the code example is the .aspx page that hosts the TextDisplayWebPart control and demonstrates the use of the HelpVerb property. Notice that near the top of the page, an <@ Register %> declaration is used to reference the compiled TextDisplayWebPart control, which should be placed in a subfolder named Bin.

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

Also note that the HelpVerb property is used declaratively on the <asp:WebPartZone> element to set the text for the verb, as shown in the following code example.

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

Finally, note in the following code example that the HelpUrl property is set on the <aspSample:TextDisplayPart> element to provide the URL to the Help file.

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

After you load the page in a browser, click the Catalog Mode menu item in the Display Mode drop-down list control to switch the page into catalog display mode. Add the TextDisplayWebPart control to the page, close the catalog, and return the page to normal browse mode. If you click the verbs drop-down menu in the title bar of the TextDisplayWebPart control, you can access the help verb to open the Help page.

.NET Framework
Available since 2.0
Return to top
Show: