Interface IPageSource
Interface for providers of PageData objects.
Namespace: EPiServer.Core
Assembly: EPiServer.dll
Version: 8.11.0Syntax
public interface IPageSource
Properties
CurrentPage
Gets the currently loaded PageData.
Declaration
PageData CurrentPage { get; }
Property Value
Type | Description |
---|---|
PageData | Returns information about the currently loaded page, or a page in a collection when used inside a control. |
Remarks
The implementation of CurrentPage
is strictly up to the implementing class.
Some of the templated Web controls implement IPageSource, and CurrentPage
will typically refer to the current page being iterated in a collection or an array.
Another implementor is the PageBase class or one of it's subclasses like
SimplePage or TemplatePage.
CurrentPage
in the context of PageBase refers to the currently
displayed page.
CurrentPage
may be null on sources that aren't connected through PageBase
.
Examples
The following code example demonstrates the usage of CurrentPage
.
Response.Write(CurrentPage.PageName);
Methods
GetChildren(PageReference)
Retrieve a PageData listing
Declaration
PageDataCollection GetChildren(PageReference pageLink)
Parameters
Type | Name | Description |
---|---|---|
PageReference | pageLink | Reference to parent page |
Returns
Type | Description |
---|---|
PageDataCollection | Returns a collection of pages directly below the page referenced by the PageReference parameter. |
Examples
The following code example demonstrates the usage of GetChildren.
GetPage(PageReference)
Retrieves a PageData object with information about a page, based on the PageReference parameter.
Declaration
PageData GetPage(PageReference pageLink)
Parameters
Type | Name | Description |
---|---|---|
PageReference | pageLink | Reference to the page being retrieved |
Returns
Type | Description |
---|---|
PageData | PageData object requested |
Examples
The following code example demonstrates how to get a start page.
The following code example demonstrates how to get a page by ID.