SaveButton.SaveItem Method (SPContext, Boolean, String)
Saves a list item and checks it in and uploads it when the list is a document library.
Namespace: Microsoft.SharePoint.WebControls
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
Syntax
'Declaration
Public Shared Function SaveItem ( _
itemContext As SPContext, _
uploadMode As Boolean, _
checkInComment As String _
) As Boolean
'Usage
Dim itemContext As SPContext
Dim uploadMode As Boolean
Dim checkInComment As String
Dim returnValue As Boolean
returnValue = SaveButton.SaveItem(itemContext, _
uploadMode, checkInComment)
public static bool SaveItem(
SPContext itemContext,
bool uploadMode,
string checkInComment
)
Parameters
itemContext
Type: Microsoft.SharePoint.SPContextAn object that contains information about the context of the request.
uploadMode
Type: System.Booleantrue to indicate that the list item is a document that is being uploaded; otherwise, false.
checkInComment
Type: System.StringThe text of a descriptive comment for the item.
Return Value
Type: System.Boolean
true in all cases.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | itemContext or checkInComment is a null reference (Nothing in Visual Basic). |
InvalidOperationException | itemContext.Item is a null reference (Nothing in Visual Basic). |
Remarks
SaveItem always returns true if the method is completed without throwing an exception.