Export (0) Print
Expand All

Wizard.FinishNavigationTemplate Property

Note: This property is new in the .NET Framework version 2.0.

Gets or sets the template that is used to display the navigation area on the Finish step.

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

[TemplateContainerAttribute(typeof(Wizard))] 
public virtual ITemplate FinishNavigationTemplate { get; set; }
/** @property */
public ITemplate get_FinishNavigationTemplate ()

/** @property */
public void set_FinishNavigationTemplate (ITemplate value)

public function get FinishNavigationTemplate () : ITemplate

public function set FinishNavigationTemplate (value : ITemplate)

Property Value

The ITemplate that defines the content for the navigation area for the Finish on the Wizard. The default is a null reference (Nothing in Visual Basic).

Use the FinishNavigationTemplate property to specify the custom content that is displayed for the navigation area on the Finish step of the Wizard control. Define the content by creating a template that specifies how the navigation area is rendered on the Finish step.

The custom content for the template is contained within the FinishNavigationTemplate object. You can add custom content to the FinishNavigationTemplate object either by using template-editing mode in design view or by defining the FinishNavigationTemplate object inline using FinishNavigationTemplate tags. The content can be as simple as plain text or more complex (embedding other controls in the template, for example).

NoteNote

The FinishNavigationTemplate object that is contained in the FinishNavigationTemplate property must contain two IButtonControl controls, one with its CommandName property set to "MoveFinish" and the other with its CommandName property set to "MovePrevious", to enable the navigation feature.

To access a control that is defined in a template programmatically, use the Controls collection of the Wizard object. You can also use the FindControl method of the Wizard object to find the control, if the control has an ID property specified.

The following code example demonstrates how to use the FinishNavigationTemplate property to create a custom template for the navigation area of the Finish step for the Wizard control.

<%@ Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

  void OnFinishButtonClick(object sender, EventArgs e)
  {
    // Insert code here that determines if an email address was
    // entered in emailTextBox. Then send an confirmation email if it was.     
  }
  
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
  <body>
    <form id="form1" 
      title="FinishNavigationTemplate Example" 
      runat="server">
      <asp:Wizard ID="Wizard1" 
        Runat="server" 
        ActiveStepIndex="0" 
        OnFinishButtonClick="OnFinishButtonClick">
        <WizardSteps>
          <asp:WizardStep Runat="server" 
            Title="Step 1">
            <!-- Put UI elements for Step 1 here. -->
            This is step one.
          </asp:WizardStep>
          <asp:WizardStep Runat="server" 
            Title="Step 2">
            <!-- Put UI elements for Step 2 here. -->
            This is step two.
          </asp:WizardStep>
          <asp:WizardStep Runat="server" 
            StepType="Complete" 
            Title="Complete">
            The Wizard has been completed.
          </asp:WizardStep>
        </WizardSteps>
        <FinishNavigationTemplate>
          Please enter your email address if you would like a confirmation email:
          <asp:TextBox ID="emailTextBox" 
            Runat="server">
          </asp:TextBox>
          &nbsp;<br />
          <asp:Button CommandName="MovePrev"
              Runat="server" 
              Text="Previous" />
          <asp:Button CommandName="MoveFinish" 
            Runat="server" 
            Text="Finish" />
        </FinishNavigationTemplate>
        <HeaderTemplate>
          <b>FinishNavigationTemplate Example</b>
        </HeaderTemplate>
      </asp:Wizard>
    </form>
  </body>
</html>

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2014 Microsoft