Share via


PasswordRecovery.OnVerifyingAnswer(LoginCancelEventArgs) 메서드

정의

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

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

매개 변수

e
LoginCancelEventArgs

이벤트 데이터를 포함하는 CancelEventArgs입니다.

예제

다음 코드 예제에서는 사용자 지정 PasswordRecovery 구현 하는 컨트롤을 OnVerifyingAnswer 메서드. 사용자 지정 클래스에는 단순히의 기본 구현을 호출 합니다 OnVerifyingAnswer 메서드.

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

    class CustomPasswordRecovery : PasswordRecovery
    {
        override protected void OnVerifyingAnswer(System.Web.UI.WebControls.LoginCancelEventArgs e)
        {
            base.OnVerifyingAnswer(e);
        }
    }
    
    // Add the custom password recovery control to the page.
    void Page_Init(object sender, EventArgs e)
    {
        CustomPasswordRecovery passwordRecoveryControl = new CustomPasswordRecovery();
        passwordRecoveryControl.ID = "passwordRecoveryControl";
        PlaceHolder1.Controls.Add(passwordRecoveryControl);
    
    }
    
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
  <head runat="server">
    <title>ASP.NET Example</title>
</head>
<body>
    <form id="form1" runat="server">
      <p>
        <asp:placeholder id="PlaceHolder1" 
          runat="server">
        </asp:placeholder>
        &nbsp;
      </p>
    </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">

    Class CustomPasswordRecovery
    
        Inherits PasswordRecovery
        
        Overloads Sub OnVerifyingAnswer(ByVal e As System.Web.UI.WebControls.LoginCancelEventArgs)
            MyBase.OnVerifyingAnswer(e)
        End Sub
        
    End Class

    ' Add the custom password recovery control to the page.
    Sub Page_Init(ByVal sender As Object, ByVal e As EventArgs)
    
        Dim passwordRecoveryControl As New CustomPasswordRecovery
        passwordRecoveryControl.ID = "passwordRecoveryControl"
        PlaceHolder1.Controls.Add(passwordRecoveryControl)
        
    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">
      <p>
        <asp:placeholder id="PlaceHolder1" 
          runat="server">
        </asp:placeholder>
        &nbsp;
      </p>
    </form>
  </body>
</html>

설명

OnVerifyingAnswer 암호 복구 확인 질문에 대 한 사용자의 대답을 확인 하도록 멤버 자격 공급자에 전송 되기 전에 호출 됩니다. 기본 구현 발생을 VerifyingAnswer 이벤트입니다.

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

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

상속자 참고

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

적용 대상

추가 정보