RegisterForPromptedSave Method

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)

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

Microsoft Visual Basic Scripting Edition:

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

Microsoft JScript:

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

Requirements

Platforms: Microsoft Windows Server 2003

Applies to: WPSC Object