다음을 통해 공유


Wizard.GetStepType(WizardStepBase, Int32) 메서드

정의

지정된 WizardStepType 개체의 WizardStepBase 값을 반환합니다.

public:
 System::Web::UI::WebControls::WizardStepType GetStepType(System::Web::UI::WebControls::WizardStepBase ^ wizardStep, int index);
public System.Web.UI.WebControls.WizardStepType GetStepType (System.Web.UI.WebControls.WizardStepBase wizardStep, int index);
member this.GetStepType : System.Web.UI.WebControls.WizardStepBase * int -> System.Web.UI.WebControls.WizardStepType
Public Function GetStepType (wizardStep As WizardStepBase, index As Integer) As WizardStepType

매개 변수

wizardStep
WizardStepBase

연결된 WizardStepType이 반환되는 WizardStepBase입니다.

index
Int32

연결된 WizardStepType이 반환되는 WizardStepBase의 인덱스입니다.

반환

WizardStepType 값 중 하나입니다.

예제

다음 코드 예제를 사용 GetStepType 하는 방법에 설명 합니다 메서드를 현재 단계에 Wizard 대 한 연결 된 WizardStepType 값을 확인 하는 컨트롤입니다. 이벤트가 발생할 때마다 ActiveStepChangedWizardStepType 값이 검색되고 메시지가 에 Label1기록됩니다.

<%@ 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)
  { 
    Label tempLabel = (Label)Wizard1.FindControl("Label1");
    if (tempLabel != null)
    {
      // Get the step type of the ActiveStep and write it to Label1.
      WizardStepType tempStepType = Wizard1.GetStepType(Wizard1.ActiveStep, Wizard1.ActiveStepIndex);
      tempLabel.Text = "The current step type is " + tempStepType.ToString() + ".";
    }   
  }
  
</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:WizardStep>
            <asp:WizardStep id="WizardStep2" 
              title="Step 2" 
              runat="server">
            </asp:WizardStep>
            <asp:WizardStep id="WizardStep3" 
              runat="server" 
              title="Step 3">
            </asp:WizardStep>
          </WizardSteps>
          <HeaderTemplate>
            <b>GetStepType Example</b>
             <br />
            <asp:Label id="Label1" 
              runat="server" 
              width="208px" 
              height="19px">
            </asp:Label>
          </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)
    
    Dim tempLabel As Label = CType(Wizard1.FindControl("Label1"), Label)
    If Not tempLabel Is Nothing Then

      ' Get the step type of the ActiveStep and write it to Label1.
      Dim tempStepType As WizardStepType = Wizard1.GetStepType(Wizard1.ActiveStep, Wizard1.ActiveStepIndex)
      tempLabel.Text = "The current step type is " & tempStepType.ToString() & "."
 
    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:WizardStep>
            <asp:WizardStep id="WizardStep2" 
              title="Step 2" 
              runat="server">
            </asp:WizardStep>
            <asp:WizardStep id="WizardStep3" 
              runat="server" 
              title="Step 3">
            </asp:WizardStep>
          </WizardSteps>
          <HeaderTemplate>
            <b>GetStepType Example</b>
             <br />
            <asp:Label id="Label1" 
              runat="server" 
              width="208px" 
              height="19px">
            </asp:Label>
          </HeaderTemplate>
        </asp:Wizard>
      </form>
  </body>
</html>

설명

메서드를 GetStepType 사용하여 지정된 WizardStepBase 개체의 값을 확인 WizardStepType 합니다.

적용 대상

추가 정보