November Happy Hour will be moved to Thursday December 5th.

Class PreviewPage

Base class for previewing pages with capability to preview other content than pages by hosting it in another page

Inheritance
System.Object
PreviewPage
Namespace: EPiServer
Assembly: EPiServer.dll
Version: 9.12.2
Syntax
public class PreviewPage : PageBase, IPageSource, ICurrentPage, ISupportsScriptManager, IContentSource
Remarks

Returns the start page as CurrentPage when hosting other content than pages, so IContentSource and IPageSource will return different content.

Constructors

PreviewPage()

Initializes a new instance of PreviewPage

Declaration
public PreviewPage()

PreviewPage(Int32)

Initializes a new instance of the PreviewPage class.

Declaration
public PreviewPage(int options)
Parameters
Type Name Description
System.Int32 options

The page options to enable.

Remarks

The options parameter is a bitmap constructed from the OptionFlag of Page plugin classes from the EPiServer.Web.PageExtensions namespace.

PreviewPage(Int32, Int32)

Initializes a new instance of the PreviewPage class.

Declaration
public PreviewPage(int enable, int disable)
Parameters
Type Name Description
System.Int32 enable

The enable.

System.Int32 disable

The disable.

Properties

Exposes the content link used to route to this web form

Declaration
public virtual ContentReference CurrentContentLink { get; set; }
Property Value
Type Description
ContentReference

CurrentData

The data that is being previewed

Declaration
public IContent CurrentData { get; }
Property Value
Type Description
IContent

CurrentLanguageSelector

Gets the language selector used for CurrentData

Declaration
[Obsolete("Use CurrentLoaderOptions instead")]
protected virtual LanguageSelector CurrentLanguageSelector { get; }
Property Value
Type Description
LanguageSelector

CurrentLoaderOptions

Gets the loader options used for CurrentData

Declaration
protected virtual LoaderOptions CurrentLoaderOptions { get; }
Property Value
Type Description
LoaderOptions

The current page, which if hosting a block is a the start page by default

Declaration
public override PageReference CurrentPageLink { get; set; }
Property Value
Type Description
PageReference
Overrides

Methods

GetHostPage()

Gets the page used for hosting when the content type is not a page itself

Declaration
protected virtual PageReference GetHostPage()
Returns
Type Description
PageReference

A page reference to use as default

OnInit(EventArgs)

Declaration
protected override void OnInit(EventArgs e)
Parameters
Type Name Description
System.EventArgs e
Overrides

SetupVisitorGroupImpersonation()

Declaration
protected override void SetupVisitorGroupImpersonation()
Overrides

ValidatePageTemplate()

Declaration
public override void ValidatePageTemplate()
Overrides

Explicit Interface Implementations

IContentSource.CurrentContent

Declaration
IContent IContentSource.CurrentContent { get; }
Returns
Type Description
IContent

Implements

Extension Methods