Skip to main content
A newer version of this page is available. .

WebModificationsController.QueryCloseAfterSave Event

Occurs when the ModificationsController.SaveAndCloseAction is executed.

Namespace: DevExpress.ExpressApp.Web.SystemModule

Assembly: DevExpress.ExpressApp.Web.v18.1.dll

Declaration

public event EventHandler<QueryCloseAfterSaveEventArgs> QueryCloseAfterSave

Event Data

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

Property Description
CloseAfterSave Specifies whether to close the current Detail View after executing the ModificationsController.SaveAndCloseAction in ASP.NET Web applications.

Remarks

Handle this event to close the current Detail View, after executing the ModificationsController.SaveAndCloseAction in ASP.NET Web applications. For this purpose, set the QueryCloseAfterSaveEventArgs.CloseAfterSave property to true.

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Web.SystemModule;
//...
public partial class MyController : ViewController {
    protected override void OnActivated() {
        base.OnActivated();
        WebModificationsController controller = Frame.GetController<WebModificationsController>();
        if (controller != null) {
            controller.QueryCloseAfterSave += OnQueryCloseAfterSave;
        }
    }
    private void OnQueryCloseAfterSave(object sender, QueryCloseAfterSaveEventArgs e) {
        e.CloseAfterSave = true;
    }
    protected override void OnDeactivated() {
       WebModificationsController controller = Frame.GetController<WebModificationsController>();
        if (controller != null) {
            controller.QueryCloseAfterSave -= OnQueryCloseAfterSave;
        }
        base.OnDeactivated();
    }
}
See Also