Редагувати

Поділитися через


EditorZoneBase.RenderVerbs(HtmlTextWriter) Method

Definition

Renders the verbs that apply at the zone level.

protected:
 override void RenderVerbs(System::Web::UI::HtmlTextWriter ^ writer);
protected override void RenderVerbs (System.Web.UI.HtmlTextWriter writer);
override this.RenderVerbs : System.Web.UI.HtmlTextWriter -> unit
Protected Overrides Sub RenderVerbs (writer As HtmlTextWriter)

Parameters

writer
HtmlTextWriter

The HtmlTextWriter that receives the zone's body content.

Examples

The following code example demonstrates how to override the RenderVerbs method in a derived class. For the full code required to run the example, see the Example section of the EditorZoneBase class overview topic.

The custom editor zone derives from the EditorZone class so that it can be used with a zone template in the declarative markup of the Web page. The custom class overrides the RenderVerbs method, adding some text to the existing value of the Text property for each of the zone-level verbs. It then calls the base method to render all the verbs.

protected override void RenderVerbs(HtmlTextWriter writer)
{
  WebPartVerb[] verbs = new WebPartVerb[] { OKVerb, 
    CancelVerb, ApplyVerb };
  foreach (WebPartVerb verb in verbs)
  {
    if (verb != null)
      verb.Text += " Verb";
  }
  base.RenderVerbs(writer);
}
  Protected Overrides Sub RenderVerbs(ByVal writer As _
    HtmlTextWriter)
    Dim verbs() As WebPartVerb = {OKVerb, CancelVerb, ApplyVerb}
    Dim verb As WebPartVerb
    For Each verb In verbs
      If Not (verb Is Nothing) Then
        verb.Text += " Verb"
      End If
    Next verb
    MyBase.RenderVerbs(writer)
  End Sub
End Class

When you load the page in a browser, you can select Edit Mode in the drop-down list control to switch to edit mode. You can click the verbs menu (the down arrow) in the title bar of one of the controls, and click Edit to edit the selected control. When the EditorZone control and editing user interface (UI) are visible, you can see the text has been changed on the buttons for the zone-level verbs at the bottom of the zone.

Remarks

The RenderVerbs method renders the verbs whose actions apply to the entire zone: the OK verb, the cancel verb, and the apply verb. These verbs are referenced in the OKVerb, CancelVerb, and ApplyVerb properties.

Applies to

See also