Delete a single version of a page.

Namespace:  EPiServer.Core
Assembly:  EPiServer (in EPiServer.dll) Version: 5.2.375.236

Syntax

C#
public virtual void DeleteVersion(
	PageReference pageLink
)

Parameters

pageLink
Type: EPiServer.Core..::.PageReference
Link to the page and version which will be deleted

Implements

IPageStore..::.DeleteVersion(PageReference)

Remarks

If versioning is to be supported this method needs to be overriden. The published version of page cannot be deleted.

Examples

The following code sample is an implementation of DeleteVersion() for XmlPageProvider.
CopyC#
public override void DeleteVersion(PageReference pageLink)
{
    if (pageLink.WorkID == 0)
    {
        throw new NullReferenceException("Version ID of page to delete is required");
    }

    XElement page = GetPageNode(pageLink);
    page.Remove();
    XmlPages.Save(_filePath);
}

Exceptions

ExceptionCondition
System..::.NotImplementedException Thrown if the Page Provider indicates support for Delete Version with the Capabilities property, but does not override Move method.
System..::.NotSupportedException Thrown if the Page Provider does not support Delete Version.

See Also