Click or drag to resize
ISharePointFileServiceRecycleFile Method
Moves the file specified by serverRelativeUrl to the recycle bin of the SharePoint server. Returns the identifier of the new recycle bin item. Recycling a non-existent file within SharePoint site returns empty GUID. Throws exception when serverRelativeUrl is invalid (does not point within any SharePoint site).

Namespace: CMS.SharePoint
Assembly: CMS.SharePoint (in CMS.SharePoint.dll) Version: 8.2.23
Syntax
C#
Guid RecycleFile(
	string serverRelativeUrl
)

Parameters

serverRelativeUrl
Type: SystemString
Server relative URL of the file.

Return Value

Type: Guid
GUID of the new recycle bin item, or Empty when file does not exist.
Exceptions
ExceptionCondition
ArgumentExceptionThrown when serverRelativeUrl does not point within any SharePoint library.
ArgumentNullExceptionThrown when serverRelativeUrl is null.
SharePointServerExceptionThrown whenever server error occurs.
WebExceptionThrown when error related to network or protocol occurs.
SharePointConnectionNotSupportedExceptionThrown when given connectionData contains unsupported authentication mode or invalid URL.
ExceptionThrown in case of unexpected error condition.
See Also