Wizard.ActiveStep Özellik

Tanım

Şu anda kullanıcıya görüntülenen koleksiyondaki WizardSteps adımı alır.

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

Özellik Değeri

WizardStepBase

WizardStepBase Şu anda kullanıcıya görüntülenen.

Öznitelikler

Özel durumlar

Karşılık gelen ActiveStepIndex -1'den küçük veya içindeki Wizardnesne sayısından WizardStepBase büyük.

Örnekler

Aşağıdaki kod örneği, denetimin ActiveStep sonraki ActiveStep özelliği olarak ayarlanacağı adımı belirlemek için özelliğinin Wizard nasıl kullanılacağını gösterir. değeri CheckBox1.Checked ise trueActiveStep özelliği olarak ayarlanırWizard1.Step3; aksi takdirde ActiveStep özelliği olarak Wizard1.Step2ayarlanır.

<%@ 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>

Açıklamalar

özelliği, ActiveStep denetimde WizardStepBase Wizard şu anda görüntülenen nesneyi döndürür. Özelliği ActiveStep salt okunurdur; ancak geçerli WizardStepBase nesnenin ActiveStep özelliklerine erişmek için özelliğini kullanabilirsiniz. ActiveStepIndex özelliğini kullanarak öğesini dinamik olarak farklı WizardStepBase bir nesneye dönüştürebilirsinizActiveStep. Alternatif olarak, özelliğini dinamik olarak ayarlamak ActiveStep için yöntemini kullanabilirsinizMoveTo.

Şunlara uygulanır

Ayrıca bkz.