LoginStatus.OnLoggingOut(LoginCancelEventArgs) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
사용자가 LoggingOut 컨트롤에 있는 로그아웃 링크를 클릭할 때 LoginStatus 이벤트를 발생시킵니다.
protected:
virtual void OnLoggingOut(System::Web::UI::WebControls::LoginCancelEventArgs ^ e);
protected virtual void OnLoggingOut (System.Web.UI.WebControls.LoginCancelEventArgs e);
abstract member OnLoggingOut : System.Web.UI.WebControls.LoginCancelEventArgs -> unit
override this.OnLoggingOut : System.Web.UI.WebControls.LoginCancelEventArgs -> unit
Protected Overridable Sub OnLoggingOut (e As LoginCancelEventArgs)
매개 변수
이벤트 데이터가 들어 있는 LoginCancelEventArgs입니다.
예제
다음 코드 예제에서는 이벤트 처리기를 연결 합니다 OnLoggingOut 이벤트입니다. 이벤트 처리기를 폼에 필드를 업데이트 하 고 로그 아웃 시도 취소 합니다.
<%@ Page Language="C#" AutoEventWireup="True" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
void LoginStatus1_LoggingOut(Object sender, System.Web.UI.WebControls.LoginCancelEventArgs e)
{
Message.Text = "LoggingOut event. Don't go away now.";
e.Cancel = true;
}
</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:LoginStatus id="LoginStatus1"
runat="server"
onloggingout="LoginStatus1_LoggingOut">
</asp:LoginStatus>
<p></p>
<asp:Literal id="Message"
runat="server" />
</form>
</body>
</html>
<%@ Page Language="VB" AutoEventWireup="True" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Sub LoginStatus1_LoggingOut(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.LoginCancelEventArgs)
Message.Text = "LoggingOut event. Don't go away now."
e.Cancel = True
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:LoginStatus id="LoginStatus1"
runat="server"
onloggingout="LoginStatus1_LoggingOut">
</asp:LoginStatus>
<p></p>
<asp:Literal id="Message"
runat="server" />
</form>
</body>
</html>
설명
사용 된 LoggingOut 같은 사용자별 데이터를 정리 하는 사이트에서 사용자가 로그인 하기 전에 추가 처리를 제공 하는 이벤트입니다. OnLoggingOut 웹 사이트를 나가기 전에 쇼핑 카트 등 데이터베이스 변경 데이터를 저장 하는 옵션을 사용자 지정할 수 있는 이벤트를 취소할 수 있습니다.
이벤트 처리에 대한 자세한 내용은 이벤트 처리 및 발생 을 참조하십시오.
또한 OnLoggingOut 메서드를 사용하면 파생 클래스가 대리자를 연결하지 않고도 이벤트를 처리할 수 있습니다. 이는 파생 클래스에서 이벤트를 처리하는 기본 방법입니다.
상속자 참고
파생 클래스에서 OnLoggingOut(LoginCancelEventArgs)를 재정의하는 경우 등록된 대리자가 이벤트를 받도록 기본 클래스의 OnLoggingOut(LoginCancelEventArgs) 메서드를 호출해야 합니다.
적용 대상
추가 정보
.NET