The requested page is not available for the requested platform. You are viewing the content for Default platform.

WebModificationsController.QueryCloseAfterSave Event

Occurs when the ModificationsController.SaveAndCloseAction is executed.

Namespace: DevExpress.ExpressApp.Web.SystemModule

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

Declaration

public event EventHandler<QueryCloseAfterSaveEventArgs> QueryCloseAfterSave
Public Event QueryCloseAfterSave As EventHandler(Of QueryCloseAfterSaveEventArgs)

Event Data

The QueryCloseAfterSave event handler receives an argument of the QueryCloseAfterSaveEventArgs type. 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