Wizard.FinishNavigationTemplate プロパティ

定義

Finish ステップのナビゲーション領域を表示するために使用されるテンプレートを取得または設定します。

public:
 virtual property System::Web::UI::ITemplate ^ FinishNavigationTemplate { System::Web::UI::ITemplate ^ get(); void set(System::Web::UI::ITemplate ^ value); };
[System.ComponentModel.Browsable(false)]
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)]
[System.Web.UI.TemplateContainer(typeof(System.Web.UI.WebControls.Wizard))]
public virtual System.Web.UI.ITemplate FinishNavigationTemplate { get; set; }
[<System.ComponentModel.Browsable(false)>]
[<System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)>]
[<System.Web.UI.TemplateContainer(typeof(System.Web.UI.WebControls.Wizard))>]
member this.FinishNavigationTemplate : System.Web.UI.ITemplate with get, set
Public Overridable Property FinishNavigationTemplate As ITemplate

プロパティ値

ITemplateFinish のナビゲーション領域に表示されるコンテンツを定義する Wizard。 既定値は、null です。

属性

次のコード例では、 プロパティを FinishNavigationTemplate 使用して、コントロールのステップのナビゲーション領域用のカスタム テンプレートを Finish 作成する方法を Wizard 示します。

重要

この例には、ユーザー入力を受け付けるテキスト ボックスがあります。これにより、セキュリティが脆弱になる可能性があります。 既定では、ASP.NET Web ページによって、ユーザー入力にスクリプトまたは HTML 要素が含まれていないかどうかが検証されます。 詳細については、「スクリプトによる攻略の概要」を参照してください。

<%@ 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" >
  <head runat="server">
    <title>ASP.NET Example</title>
</head>
<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>
           <br />
          <asp:Button CommandName="MovePrevious"
              Runat="server" 
              Text="Previous" />
          <asp:Button CommandName="MoveComplete" 
            Runat="server" 
            Text="Finish" />
        </FinishNavigationTemplate>
        <HeaderTemplate>
          <b>FinishNavigationTemplate Example</b>
        </HeaderTemplate>
      </asp:Wizard>
    </form>
  </body>
</html>
<%@ Page Language="VB" %>

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

<script runat="server">
  
  Sub OnFinishButtonClick(ByVal sender As Object, ByVal e As WizardNavigationEventArgs)
    ' Insert code here that determines if an email address was
    ' entered in emailTextBox. Then send an confirmation email if it was.     
  End Sub

</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>ASP.NET Example</title>
</head>
<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>
           <br />
          <asp:Button CommandName="MovePrevious"
              Runat="server" 
              Text="Previous" />
          <asp:Button CommandName="MoveComplete" 
            Runat="server" 
            Text="Finish" />
        </FinishNavigationTemplate>
        <HeaderTemplate>
          <b>FinishNavigationTemplate Example</b>
        </HeaderTemplate>
      </asp:Wizard>
    </form>
  </body>
</html>

注釈

コントロールのステップでFinishNavigationTemplateナビゲーション領域に表示されるカスタム コンテンツを指定するには、 プロパティをFinishWizard使用します。 ステップでナビゲーション領域をレンダリングする方法を指定するテンプレートを作成して、コンテンツを Finish 定義します。

テンプレートのカスタム コンテンツは、 オブジェクト内に FinishNavigationTemplate 含まれています。 カスタム コンテンツをオブジェクトにFinishNavigationTemplate追加するには、デザイン ビューでテンプレート編集モードを使用するか、タグを使用してFinishNavigationTemplateオブジェクトをFinishNavigationTemplateインラインで定義します。 コンテンツは、プレーン テキストと同じくらい単純にすることも、より複雑にすることもできます (たとえば、テンプレートに他のコントロールを埋め込む)。

Note

FinishNavigationTemplateナビゲーション機能を有効にするには、プロパティにFinishNavigationTemplate含まれるオブジェクトに 2 つのIButtonControlコントロールが含まれている必要があります。1 つはCommandNameプロパティが "MoveComplete" に設定され、もう 1 つはCommandNameプロパティが "MovePrevious" に設定されています。

プログラムによってテンプレートで定義されているコントロールにアクセスするには、 オブジェクトのコレクションをControlsWizard使用します。 コントロールにプロパティが FindControl 指定されている場合は、 オブジェクトの Wizard メソッドを使用してコントロールを ID 検索することもできます。

適用対象

こちらもご覧ください