Wizard.OnSideBarButtonClick(WizardNavigationEventArgs) 메서드

정의

SideBarButtonClick 이벤트를 발생시킵니다.

protected:
 virtual void OnSideBarButtonClick(System::Web::UI::WebControls::WizardNavigationEventArgs ^ e);
protected virtual void OnSideBarButtonClick (System.Web.UI.WebControls.WizardNavigationEventArgs e);
abstract member OnSideBarButtonClick : System.Web.UI.WebControls.WizardNavigationEventArgs -> unit
override this.OnSideBarButtonClick : System.Web.UI.WebControls.WizardNavigationEventArgs -> unit
Protected Overridable Sub OnSideBarButtonClick (e As WizardNavigationEventArgs)

매개 변수

e
WizardNavigationEventArgs

이벤트 데이터가 포함된 WizardNavigationEventArgs입니다.

예제

다음 코드 예제에서는 이벤트에 대 한 이벤트 처리기를 지정 하는 방법을 보여 줍니다 SideBarButtonClick . 이벤트가 발생할 때마다 SideBarButtonClick 사이드바 영역 단추를 클릭한 정보가 포함된 에 대한 Label1 메시지가 속성에 기록 Text 됩니다.

<%@ 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 OnSideBarButtonClick(object sender, WizardNavigationEventArgs e)
  {
    // When a button in the sidebar area is clicked, put a message
    // in Label1 to be displayed in the header area.
    Label tempLabel = (Label)Wizard1.FindControl("Label1");
    if (tempLabel != null)
    {
      tempLabel.Text = "You clicked the button for Step " + 
        (e.NextStepIndex + 1) + ".";
    }
  }

</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" 
        onsidebarbuttonclick="OnSideBarButtonClick">
        <WizardSteps>
          <asp:WizardStep id="WizardStep1" 
            runat="server" 
            title="Step 1">
          </asp:WizardStep>
          <asp:WizardStep id="WizardStep2" 
            runat="server" 
            title="Step 2">
          </asp:WizardStep>
          <asp:WizardStep id="WizardStep3" 
            runat="server" 
            title="Step 3">
          </asp:WizardStep>
        </WizardSteps>
        <HeaderTemplate>
          <b>SideBarButtonClick 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 OnSideBarButtonClick(ByVal sender As Object, ByVal e As WizardNavigationEventArgs)
    ' When a button in the sidebar area is clicked, put a message
    ' in Label1 to be displayed in the header area.
    Dim tempLabel As Label = CType(Wizard1.FindControl("Label1"), Label)
    If Not tempLabel Is Nothing Then
      tempLabel.Text = "You clicked the button for Step " & _
        (e.NextStepIndex + 1) & "."
    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" 
        onsidebarbuttonclick="OnSideBarButtonClick">
        <WizardSteps>
          <asp:WizardStep id="WizardStep1" 
            runat="server" 
            title="Step 1">
          </asp:WizardStep>
          <asp:WizardStep id="WizardStep2" 
            runat="server" 
            title="Step 2">
          </asp:WizardStep>
          <asp:WizardStep id="WizardStep3" 
            runat="server" 
            title="Step 3">
          </asp:WizardStep>
        </WizardSteps>
        <HeaderTemplate>
          <b>SideBarButtonClick Example</b>
           <br />
          <asp:Label id="Label1" 
            runat="server" 
            width="208px" 
            height="19px">
          </asp:Label>
        </HeaderTemplate>
      </asp:Wizard>
    </form>
  </body>
</html>

설명

이벤트는 SideBarButtonClick 사이드바 영역의 단추를 클릭할 때 발생합니다.

참고

속성이 SideBarButtonClick 로 설정된 Move 컨트롤이 개체에 대한 SideBarTemplate 컨트롤 CommandName 의 사이드바 목록 외부에 DataList 있으면 이벤트가 발생하지 Button 않습니다.

이벤트가 발생하면 대리자를 통해 이벤트 처리기가 호출됩니다. 자세한 내용은 이벤트 처리 및 발생합니다.

또한 OnSideBarButtonClick 메서드를 사용하면 파생 클래스가 대리자를 연결하지 않고도 이벤트를 처리할 수 있습니다. 이는 파생 클래스에서 이벤트를 처리하는 기본 방법입니다.

상속자 참고

재정의 하는 경우는 OnSideBarButtonClick(WizardNavigationEventArgs) 파생된 클래스에서 메서드를 호출 해야 합니다 OnSideBarButtonClick(WizardNavigationEventArgs) 대리자를 등록 하는 기본 클래스의 메서드는 이벤트를 받도록 합니다.

적용 대상

추가 정보