Share via


SPRecycleBinItem.Delete Method

Permanently deletes the item from the Recycle Bin.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

Syntax

'Declaration
<ClientCallableMethodAttribute(Name := "DeleteObject", RemoveThisObjectFromParentCollection := True)> _
<ClientCallableExceptionConstraintAttribute(FixedId := "1", Condition := "Item does not exist. It may have been restored or deleted by another user.",  _
    ErrorType := GetType(ArgumentException))> _
<ClientCallableExceptionConstraintAttribute(FixedId := "accessdenied", Condition := "Lack of permissions to perform the operation.",  _
    ErrorType := GetType(UnauthorizedAccessException))> _
Public Sub Delete
'Usage
Dim instance As SPRecycleBinItem

instance.Delete()
[ClientCallableMethodAttribute(Name = "DeleteObject", RemoveThisObjectFromParentCollection = true)]
[ClientCallableExceptionConstraintAttribute(FixedId = "1", Condition = "Item does not exist. It may have been restored or deleted by another user.", 
    ErrorType = typeof(ArgumentException))]
[ClientCallableExceptionConstraintAttribute(FixedId = "accessdenied", Condition = "Lack of permissions to perform the operation.", 
    ErrorType = typeof(UnauthorizedAccessException))]
public void Delete()

Exceptions

Exception Condition
InvalidOperationException

The item could not be found.

See Also

Reference

SPRecycleBinItem Class

SPRecycleBinItem Members

Microsoft.SharePoint Namespace