Wizard.ActiveStep Özellik
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
Ş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
WizardStepBase Şu anda kullanıcıya görüntülenen.
- Öznitelikler
Karşılık gelen ActiveStepIndex -1'den küçük veya içindeki Wizardnesne sayısından WizardStepBase büyük.
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 true
ActiveStep özelliği olarak ayarlanırWizard1.Step3
; aksi takdirde ActiveStep özelliği olarak Wizard1.Step2
ayarlanı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>
özelliği, ActiveStep denetimde WizardStepBaseWizard ş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.
Ürün | Sürümler |
---|---|
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET geri bildirimi
.NET, açık kaynak bir projedir. Geri bildirim sağlamak için bir bağlantı seçin: