RegisterForPromptedSave Method

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Provides a way for the Web Part Page Services Component (WPSC) to prompt the user to save changes when a Web Part has been modified and the user navigates away from the page or the page is posted to the server.

RegisterForPromptedSave (IsDirtyCallbackFunction, SaveCallbackFunction, Param)

Parameters

Parameter

Description

IsDirtyCallbackFunction

A pointer to a function that is called when the page is unloaded. If it returns true, WPSC then calls SaveCallbackFunction.

SaveCallbackFunction

A pointer to a function that saves the properties of the Web Part.

Param

Optional. A parameter that is passed to IsDirtyCallbackFunction and SaveCallbackFunction. It can contain any data that is required by either function.

Remarks

This method also enables Web Parts to prompt the user only once, rather then multiple times, when one or more Web Parts are changed and the page is unloaded.

Example 1: Microsoft Visual Basic Scripting Edition

Code

WPSC.RegisterForPromptedSave Getref("myChangedFunction"), Getref("mySaveFunction"), "param"

Example 2: Microsoft JScript

Code

WPSC.RegisterForPromptedSave(myChangedFunction, mySaveFunction, "param");

Requirements

Applies to: WPSC Object

See Also

Other Resources

Web Part Page Services Component (WPSC) Object Model