Copy a page to another container.

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

Syntax

C#
PageReference Copy(
	PageReference pageLink,
	PageReference destinationLink,
	bool publishOnDestination,
	bool allowThreading
)

Parameters

pageLink
Type: EPiServer.Core..::.PageReference
The link to the page to copy.
destinationLink
Type: EPiServer.Core..::.PageReference
The container where the page will be copied
publishOnDestination
Type: System..::.Boolean
If the new pages should be published on the destination
allowThreading
Type: System..::.Boolean
Run the local copy process on a separate thread (don't work for remote sites).

Remarks

Note, when a page is copied successfully the CreatedPage event is fired, since a page is created in the copy process. But in contrast to the Save method, that also fires the CreatedPage method and always passes an initialized PageData object in the PageEventArgs object to the event handler, the Copy method does not. Instead it only passes a pagereference to the copied page and it is up to the handler to load the page data. The reason for this behavior in the Copy method is performance.

Exceptions

ExceptionCondition
EPiServer.Core..::.AccessDeniedException Thrown when user doesnt have enough access right to perform this action

See Also