Delete children of a page. If delete is to be supported this method needs to be overriden.

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

Syntax

C#
public virtual void DeleteChildren(
	PageReference pageLink,
	bool forceDelete
)

Parameters

pageLink
Type: EPiServer.Core..::.PageReference
The children of this page will be deleted.
forceDelete
Type: System..::.Boolean
Delete page even if referenced by other pages.

Implements

IPageStore..::.DeleteChildren(PageReference, Boolean)

Examples

Here is the example of implementation for DeleteChildren
CopyC#
public override void DeleteChildren(PageReference pageLink, bool forceDelete)
{
    PageReferenceCollection pageLinks = GetChildrenReferences(pageLink, null);
    if (pageLinks.Count == 0)
    {
        // Nothing to delete
        return;
    }

    foreach (PageReference childPageLink in pageLinks)
    {
        Delete(childPageLink, forceDelete);
    }
    XmlPages.Save(_filePath);
}

Exceptions

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

See Also