Delete a page from database

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

Syntax

C#
public void Delete(
	PageReference pageLink,
	bool forceDelete,
	AccessLevel access
)

Parameters

pageLink
Type: EPiServer.Core..::.PageReference
The link to the page which will be deleted
forceDelete
Type: System..::.Boolean
Delete page even if being linked by other pages
access
Type: EPiServer.Security..::.AccessLevel
The required access level for delete

Return Value

True if the delete was successful

Exceptions

ExceptionCondition
EPiServer.Core..::.AccessDeniedException Thrown AccessDeniedException when user doesnt have access right to perform this action
System..::.ArgumentNullException Thrown when the pageLink is NOT vaild
EPiServer.Core..::.EPiServerCancelException Thrown when the DeletingEvent be canceled

See Also