Occurs when a user clicks the Log Off button or the ASP.NET session ends.
public event EventHandler<LoggingOffEventArgs> LoggingOff
Public Event LoggingOff As EventHandler(Of LoggingOffEventArgs)
The LoggingOff event handler receives an argument of the LoggingOffEventArgs type. The following properties provide information specific to this event.
|CanCancel||Indicates whether the log off process can be canceled.|
Gets or sets a value indicating whether the event should be canceled.
(Inherited from CancelEventArgs)
|LogonParameters||Specifies the Security System's logon parameters.|
Handle this event to execute custom code before a user has logged off. If the log off process has been initiated by a user (via the Log Off LogoffController.LogoffAction), the LoggingOffEventArgs.CanCancel property returns true, and you can cancel the process by setting the handler's Cancel parameter to true.
When the LoggingOff event is raised as a result of an ASP.NET session ending, the HttpContext.Current property is null. So when the ASP.NET session ends, you cannot use XAF singleton instances such as XafApplication and Security System in the LoggingOff event handler. For example, suppose you are handling the LoggingOff event, and it is raised as a result of ASP.NET session ending. If you access the WebApplication.Instance property in the event handler, the property will return null.