XafApplication.LoggingOff Event

Occurs when a user clicks the Log Off button or the ASP.NET session ends.

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v18.1.dll

Syntax

public event EventHandler<LoggingOffEventArgs> LoggingOff

The event handler receives an argument of the LoggingOffEventArgs type. The LoggingOffEventArgs properties provide information specific to this event.

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.

Note

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.

See Also