Table of Contents

Interface ICmsPage

Namespace
ToSic.Sxc.Context
Assembly
ToSic.Sxc.dll

Information about the page which is the context for the currently running code.

🪒 In Dynamic Razor it's found on CmsContext.Page
🪒 In Typed Razor it's found on MyPage

[PublicApi]
public interface ICmsPage : IHasMetadata

Remarks

Note that the module context is the module for which the code is currently running. In some scenarios (like Web-API scenarios) the code is running for this page but not on this page, as it would then be running on a WebApi.

Properties

Id

The Id of the page.

🪒 Use in Dynamic Razor: CmsContext.Page.Id
🪒 Use in Typed Razor: MyPage.Id

int Id { get; }

Property Value

int

Remarks

Corresponds to the Dnn TabId or the Oqtane Page.PageId

Metadata

Metadata of the current page

[JsonIgnore]
IMetadata Metadata { get; }

Property Value

IMetadata

Remarks

Added in v13.12

Parameters

The page parameters, cross-platform. Use this for easy access to url parameters like ?id=xyz with CmsContext.Page.Parameters["id"] as a replacement for Request.QueryString["id"]

🪒 Use in Dynamic Razor: CmsContext.Page.Parameters
🪒 Use in Typed Razor: MyPage.Parameters

IParameters Parameters { get; }

Property Value

IParameters

Url

The resource specific Url, like the one to this page or portal.

🪒 Use in Dynamic Razor: CmsContext.Page.Url
🪒 Use in Typed Razor: MyPage.Url

string Url { get; }

Property Value

string

Remarks

Added ca. v12.