AuthenticateEventArgs クラス
アセンブリ: System.Web (system.web.dll 内)


AuthenticateEventArgs クラスは、Authenticate イベントに必要なデータを提供します。Web サイトのカスタム認証方式では、Authenticated プロパティを使用して、ユーザーのログインが成功したかどうかを示します。

AuthenticateEventArgs クラスを使用して、カスタム認証メソッドにデータを渡す方法を次のコード例に示します。
<%@ 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"> Function SiteSpecificAuthenticationMethod(ByVal UserName As String, ByVal Password As String) As Boolean ' Insert code that implements a site-specific custom ' authentication method here. ' ' This example implementation always returns false. Return False End Function Sub OnAuthenticate(ByVal sender As Object, ByVal e As AuthenticateEventArgs) Dim Authenticated As Boolean Authenticated = SiteSpecificAuthenticationMethod(Login1.UserName, Login1.Password) e.Authenticated = Authenticated End Sub </SCRIPT> <HTML> <BODY> <FORM runat="server"> <asp:Login id="Login1" runat="server" OnAuthenticate="OnAuthenticate"> </asp:Login> </FORM> </BODY> </HTML>
<%@ 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"> private bool SiteSpecificAuthenticationMethod(string UserName, string Password) { // Insert code that implements a site-specific custom // authentication method here. // // This example implementation always returns false. return false; } private void OnAuthenticate(object sender, AuthenticateEventArgs e) { bool Authenticated = false; Authenticated = SiteSpecificAuthenticationMethod(Login1.UserName, Login1.Password); e.Authenticated = Authenticated; } </SCRIPT> <HTML> <BODY> <FORM runat="server"> <asp:Login id="Login1" runat="server" OnAuthenticate="OnAuthenticate"> </asp:Login> </FORM> </BODY> </HTML>


System.EventArgs
System.Web.UI.WebControls.AuthenticateEventArgs


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


- AuthenticateEventArgs クラスのページへのリンク