Sys.Application.unload Event
Raised before all objects in the client application are disposed, typically when the DOM window.unload event is raised.
Sys.Application.add_unload(handler);
Sys.Application.remove_unload(handler);
Arguments
- handler
The delegate function to bind or unbind from the unload event.
Remarks
Attach delegate functions to the unload event to complete any tasks that must be performed before the client application is unloaded. This event is raised before all objects in the client application are disposed, typically when the DOM window.unload event is raised. The add_unload accessor binds a delegate function to the unload event, and the remove_unload accessor unbinds it.
Example
The following example how to create a handler for the unload event that opens a new browser window for the user to complete a survey.
// Attach a handler to the unLoad event.
Sys.Application.add_unload(applicationUnloadHandler);
function applicationUnloadHandler() {
// Redirect user to a survey form.
window.open("SurveyForm.aspx");
}