RegisterForPromptedSave Method
Applies to: SharePoint Foundation 2010
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