Interface ICmsPage
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
Namespace: ToSic.Sxc.Context
Assembly: ToSic.Sxc.dll
Syntax
[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
| Improve this Doc View SourceId
The Id of the page.
🪒 Use in Dynamic Razor: CmsContext.Page.Id
🪒 Use in Typed Razor: MyPage.Id
Declaration
int Id { get; }
Property Value
Type | Description |
---|---|
int |
Remarks
Corresponds to the Dnn TabId
or the Oqtane Page.PageId
Metadata
Metadata of the current page
Declaration
IMetadata Metadata { get; }
Property Value
Type | Description |
---|---|
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
Declaration
IParameters Parameters { get; }
Property Value
Type | Description |
---|---|
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
Declaration
string Url { get; }
Property Value
Type | Description |
---|---|
string |
Remarks
Added ca. v12.