WizardStepBase.ID Özellik

Tanım

Sunucu denetimine atanan program tanımlayıcısını alır veya ayarlar.

public:
 virtual property System::String ^ ID { System::String ^ get(); void set(System::String ^ value); };
public override string ID { get; set; }
member this.ID : string with get, set
Public Overrides Property ID As String

Özellik Değeri

Denetime atanan program tanımlayıcısı.

Özel durumlar

özelliği, tasarım zamanında geçersiz bir tanımlayıcı dizesine ayarlandı.

-veya-

özelliği, tasarım zamanında içeren Wizard denetimle aynı tanımlayıcıya ayarlanmıştır.

-veya-

özelliği, tasarım zamanında denetim içeren Wizard başka bir adımla aynı tanımlayıcıya ayarlanmıştır.

Örnekler

Aşağıdaki kod örneği, bir Web Forms sayfasındaki denetim Wizard için üç sihirbaz adımını tanımlar. Sayfanın kodunda sihirbaz adımı örnekleri kimlik değerleriyle adlandırılır ve kodda , WizardStep2ve WizardStep3olarak WizardStep1başvurulabilir.

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

ID Web Forms sayfasındaki belirli bir sihirbaz adımı denetimini tanımlamak ve bunlara başvurmak için özelliğini kullanın. Değer, ID sayfadaki denetim örneğinin adı olur; bu, söz konusu sayfa için kodda belirli bir adıma kolayca erişmenizi sağlar. Örneğin, bir WizardStepBase denetimin ID özelliğini "Adım1" olarak ayarlarsanız, bu sayfanın kodunda sihirbaz adımının alt denetimlerine olarak Step1.Controlsbaşvurabilirsiniz.

Denetim, WizardStepBase tasarım zamanında adımlar eklendiğinde veya değiştirildiğinde denetimdeki Wizard her adımın geçerli bir benzersiz tanımlayıcıya sahip olmasını sağlar. Örneğin, tasarım zamanında bir adım için ayarladığınızda ID , denetimin içerdiği başka bir adımın Wizard tanımlayıcısı ile eşleşemez ve içeren denetimin tanımlayıcısı IDWizard ile eşleşemez.

Şunlara uygulanır

Ayrıca bkz.