Share via


SPPageStateControl.EnsureItemSavedIfEditMode method (Boolean)

Ensures an item is saved to the server if it is necessary, and forces a save if there are version conflicts.

Namespace:  Microsoft.SharePoint.WebControls
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Overridable Function EnsureItemSavedIfEditMode ( _
    forceSave As Boolean _
) As Boolean
'Usage
Dim instance As SPPageStateControl
Dim forceSave As Boolean
Dim returnValue As Boolean

returnValue = instance.EnsureItemSavedIfEditMode(forceSave)
public virtual bool EnsureItemSavedIfEditMode(
    bool forceSave
)

Parameters

  • forceSave
    Type: System.Boolean

    true forces the item to be saved even if there are version conflicts, before proceeding with the requested server action.

Return value

Type: System.Boolean
true to ensure an item is saved; otherwise, false.

Remarks

If the command handler performs an action such as checking in or publishing a file to the server, it should call this method to save the item back to the server before the server performs the requested action. This method ensures that the item is saved if this action is required.

See also

Reference

SPPageStateControl class

SPPageStateControl members

EnsureItemSavedIfEditMode overload

Microsoft.SharePoint.WebControls namespace