PasswordRecovery.OnVerifyingUser(LoginCancelEventArgs) Yöntem

Tanım

Olayı tetikler VerifyingUser .

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

Parametreler

e
LoginCancelEventArgs

CancelEventArgs Olay verilerini içeren bir.

Örnekler

Aşağıdaki kod örneği, yöntemini uygulayan OnVerifyingUser özel PasswordRecovery bir denetim oluşturur. Özel sınıf yalnızca yönteminin temel uygulamasını OnVerifyingUser çağırı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">

    class CustomPasswordRecovery : PasswordRecovery
    {
        override protected void OnVerifyingUser(System.Web.UI.WebControls.LoginCancelEventArgs e)
        {
            base.OnVerifyingUser(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 OnVerifyingUser(ByVal e As System.Web.UI.WebControls.LoginCancelEventArgs)
            MyBase.OnVerifyingUser(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>

Açıklamalar

yöntemi OnVerifyingUser , kullanıcı ilk ekranda bir kullanıcı adı gönderdikten sonra ve kullanıcı adı üyelik sağlayıcısı tarafından doğrulandıktan önce çağrılır. Varsayılan uygulama olayı tetikler VerifyingUser .

Olay bildirmek, bir temsilci yoluyla olay işleyicisini çağırır. Daha fazla bilgi için bkz. Olayları İşleme ve Oluşturma.

yöntemi, OnVerifyingUser türetilmiş sınıfların bir temsilci eklemeden olayı işlemesine de izin verir. Bu, türetilmiş bir sınıftaki olayı işlemek için tercih edilen tekniktir.

Devralanlara Notlar

Türetilmiş bir sınıfta geçersiz kılma OnVerifyingUser(LoginCancelEventArgs) sırasında, kayıtlı temsilcilerin olayı alması için temel sınıfın OnVerifyingUser(LoginCancelEventArgs) yöntemini çağırdığınızdan emin olun.

Şunlara uygulanır

Ayrıca bkz.