Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Class PageBase<T>

Page Template class for supporting strongly typed PageData objects with an arbitrary type T.

Inheritance
System.Object
PageBase<T>
Namespace: EPiServer
Assembly: EPiServer.Cms.AspNet.dll
Version: 11.20.7
Syntax
public class PageBase<T> : PageBase, ICurrentPage, IContentSource, ISupportsScriptManager, IPageSource<T>, IPageSource, IRenderTemplate<T>, IRenderTemplate where T : PageData
Type Parameters
Name Description
T

The strongly typed PageData type.

Constructors

PageBase(Int32)

Initializes a new instance of the PageBase<T> class.

Declaration
public PageBase(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.

PageBase(Int32, Int32)

Initializes a new instance of the PageBase<T> class.

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

The page options to enable.

System.Int32 disable

The page options to disable.

Remarks

The disable bitmap will override enabled options in case of conflicting options.

Properties

CurrentPage

Gets or sets the current page of T.

Declaration
public virtual T CurrentPage { get; set; }
Property Value
Type Description
T

The current page.

Remarks

Replaces the CurrentPage from base with a strongly typed version.

Examples
  The following example demonstrates the usage of <strong>CurrentPage</strong> on a template page that uses a strongly typed model.
using EPiServer;
using EPiServer.Core;
using EPiServer.DataAnnotations;

namespace CodeSamples
{
public class NewsPage : TemplatePage<NewsPageModel>
{
protected override void OnLoad(System.EventArgs e)
{
string mainBody = CurrentPage.MainBody;
}
}

[ContentType]
public class NewsPageModel : PageData
{
public virtual string MainBody { get; set; }
}
}

EditHints

Gets the list containing the names of properties that have been registered for full refresh.

Declaration
public FullRefreshEditHintCollection<T> EditHints { get; }
Property Value
Type Description
FullRefreshEditHintCollection<T>
Remarks

Replaces the EditHints property in the base class and changes the return type. This list will be read by the FullRefreshPropertiesMetaData and output as a comma separated list that that will be collected by the edit interface client.

Implements

Extension Methods