Back to Devexpress

How to: Disable a Confirmation Dialog in an ASP.NET Core Blazor Application

expressappframework-404550-app-shell-and-base-infrastructure-dialogs-and-notifications-how-to-disable-confirmation-dialog-in-xaf-blazor.md

latest1.4 KB
Original Source

How to: Disable a Confirmation Dialog in an ASP.NET Core Blazor Application

  • Dec 22, 2023

In XAF ASP.NET Core Blazor applications, a confirmation dialog appears if you attempt to exit a view without saving your changes. The following Controllers implement this functionality:

  • ConfirmationDetailViewController in Detail Views.
  • ConfirmationListViewController in List Views.

This topic demonstrates how to disable the confirmation dialog in a Detail View.

Step-by-Step Instructions

  1. In the YourSolutionName.Blazor.Server\Controllers folder, create a new Controller and name it BlazorSuppressConfirmationsController.

  2. Replace the auto-generated code with the following code snippet:

  3. Build the project and run the application. Open a Detail View and change a property value. When you close the view, XAF does not save the changes and the confirmation dialog does not appear.

Tip

The ConfirmationDetailViewController and ConfirmationListViewController are active for non-persistent objects only if the AutoSetModifiedOnObjectChange property is set to true.

See Also

ConfirmUnsavedChanges