Class TemplatePage<T>
Base class for EPiServer page templates that enables the quick navigator to get to the EPiServer UI.
Implements
IPageSource<T>
    
    
    
  Inherited Members
Namespace: EPiServer
Assembly: EPiServer.dll
Version: 10.10.4Syntax
public class TemplatePage<T> : PageBase<T>, ICurrentPage, IContentSource, ISupportsScriptManager, IPageSource<T>, IPageSource, IRenderTemplate<T>, IRenderTemplate where T : PageDataType Parameters
| Name | Description | 
|---|---|
| T | 
Examples
The following example demonstrates how you would make 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; }
}
}Constructors
TemplatePage()
Initializes a new instance of the TemplatePage class.
Declaration
public TemplatePage()TemplatePage(Int32)
Initializes a new instance of the TemplatePage class.
Declaration
public TemplatePage(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.
TemplatePage(Int32, Int32)
Initializes a new instance of the TemplatePage class.
Declaration
public TemplatePage(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.
