Wizard.ActiveStep プロパティ

定義

現在ユーザーに表示されている WizardSteps コレクション内のステップを取得します。

public:
 property System::Web::UI::WebControls::WizardStepBase ^ ActiveStep { System::Web::UI::WebControls::WizardStepBase ^ get(); };
[System.ComponentModel.Browsable(false)]
public System.Web.UI.WebControls.WizardStepBase ActiveStep { get; }
[<System.ComponentModel.Browsable(false)>]
member this.ActiveStep : System.Web.UI.WebControls.WizardStepBase
Public ReadOnly Property ActiveStep As WizardStepBase

プロパティ値

WizardStepBase

現在ユーザーに表示されている WizardStepBase

属性

例外

対応する ActiveStepIndex が -1 未満か、WizardStepBase 内の Wizard オブジェクトの数よりも大きい値です。

次のコード例では、プロパティを使用して、コントロールの ActiveStepActiveStep のプロパティとして設定するステップを決定する方法を Wizard 示します。 の値CheckBox1.Checked``trueの場合、ActiveStepプロパティは ;にWizard1.Step3設定されます。それ以外のActiveStep場合、プロパティは Wizard1.Step2.

<%@ 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 OnActiveStepChanged(object sender, EventArgs e)
  {
    // If the ActiveStep is changing to Step2 check to see if the 
    // CheckBox1 CheckBox is checked.  If it is then skip 
    // to the Step3 step.
    if (Wizard1.ActiveStep == this.WizardStep2)
    {
      if (this.CheckBox1.Checked)
      {
        Wizard1.ActiveStepIndex = Wizard1.WizardSteps.IndexOf(this.WizardStep3);
      }
    }
  }
  
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>ASP.NET Example</title>
</head>
<body>
      <form id="form1" runat="server">
        <asp:Wizard ID="Wizard1" 
          Runat="server"
          OnActiveStepChanged="OnActiveStepChanged">
          <WizardSteps>
            <asp:WizardStep ID="WizardStep1" 
              Title="Step 1" 
              Runat="server">
              <asp:CheckBox ID="CheckBox1" 
                Runat="Server" 
                Text="Check this checkbox to skip Step 2." />
                You are currently on Step 1.
            </asp:WizardStep>
            <asp:WizardStep ID="WizardStep2" 
              Title="Step 2" 
              Runat="server">
              You are currently on Step 2.
            </asp:WizardStep>
            <asp:WizardStep ID="WizardStep3" 
              Runat="server" 
              Title="Step 3">
              You are currently on Step 3.
            </asp:WizardStep>
          </WizardSteps>
          <HeaderTemplate>
            <b>ActiveStepIndex 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 OnActiveStepChanged(ByVal sender As Object, ByVal e As EventArgs)
    ' If the ActiveStep is changing to Step2 check to see if the 
    ' CheckBox1 CheckBox is checked.  If it is then skip 
    ' to the Step3 step.
    If Wizard1.ActiveStep.Equals(Me.WizardStep2) Then
      If (Me.CheckBox1.Checked) Then
        Wizard1.ActiveStepIndex = Wizard1.WizardSteps.IndexOf(Me.WizardStep3)
      End If
    End If
  End Sub
  
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>ASP.NET Example</title>
</head>
<body>
      <form id="form1" runat="server">
        <asp:Wizard ID="Wizard1" 
          Runat="server"
          OnActiveStepChanged="OnActiveStepChanged">
          <WizardSteps>
            <asp:WizardStep ID="WizardStep1" 
              Title="Step 1" 
              Runat="server">
              <asp:CheckBox ID="CheckBox1" 
                Runat="Server" 
                Text="Check this checkbox to skip Step 2." />
                You are currently on Step 1.
            </asp:WizardStep>
            <asp:WizardStep ID="WizardStep2" 
              Title="Step 2" 
              Runat="server">
              You are currently on Step 2.
            </asp:WizardStep>
            <asp:WizardStep ID="WizardStep3" 
              Runat="server" 
              Title="Step 3">
              You are currently on Step 3.
            </asp:WizardStep>
          </WizardSteps>
          <HeaderTemplate>
            <b>ActiveStepIndex Example</b>
          </HeaderTemplate>
        </asp:Wizard>
      </form>
  </body>
</html>

注釈

このプロパティは ActiveStep 、コントロールに WizardStepBase 現在表示されているオブジェクトを Wizard 返します。 プロパティは ActiveStep 読み取り専用ですが、このプロパティを ActiveStep 使用して現在 WizardStepBase のオブジェクトのプロパティにアクセスできます。 プロパティをActiveStepIndex使用して、別WizardStepBaseActiveStepオブジェクトに動的に変更します。 または、メソッドを MoveTo 使用してプロパティを動的に設定 ActiveStep することもできます。

適用対象

こちらもご覧ください