Skip to main content
.NET 8.0+

XafApplication.LoggingOff Event

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

Namespace: DevExpress.ExpressApp

Assembly: DevExpress.ExpressApp.v24.2.dll

NuGet Package: DevExpress.ExpressApp

Declaration

public event EventHandler<LoggingOffEventArgs> LoggingOff

Event Data

The LoggingOff event's data class is LoggingOffEventArgs. The following properties provide information specific to this event:

Property Description
CanCancel Indicates whether the log off process can be canceled.
Cancel Gets or sets a value indicating whether the event should be canceled. Inherited from CancelEventArgs.
LogonParameters Specifies the Security System‘s logon parameters.

Remarks

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 Web Forms session ending, the HttpContext.Current property is null. So when the ASP.NET Web Forms 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 Web Forms session ending. If you access the WebApplication.Instance property in the event handler, the property will return null.

See Also