#4 CmsContext.Page – Id, Parameters, etc.
Interface ICmsPage
Get information about the page which is the contxt for the currently running code.
Output
The .Id attribute:
The id of the current site is (this is the same as TabId
in DNN or Page.PageId
in oqtane.):
1193
<h3>The .Id attribute:</h3>
The id of the current site is (this is the same as <code>TabId</code> in DNN or <code>Page.PageId</code> in oqtane.):
<strong>
@CmsContext.Page.Id
</strong>
Output
Access all parameters with .Parameters:
Use this to get a string which contains all url parameters:
c140=page
>
<h3>Access all parameters with .Parameters:</h3>
Use this to get a string which contains all url parameters:
<strong>
@CmsContext.Page.Parameters.ToString()
</strong>>
Output
Access a specific parameter with .Parameters:
Use this to access the value of a specific url parameter:
page
<h3>Access a specific parameter with .Parameters:</h3>
Use this to access the value of a specific url parameter:
<strong>
@CmsContext.Page.Parameters["c140"]
</strong>
#4 CmsContext.Page – Id, Parameters, etc.
@inherits Custom.Hybrid.Razor14
@using ToSic.Razor.Blade;
<!-- unimportant stuff, hidden -->
<div @Sys.PageParts.InfoWrapper()>
@Html.Partial("../shared/DefaultInfoSection.cshtml")
<div @Sys.PageParts.InfoIntro()>
<h2>Interface ICmsPage</h2>
<p>
Get information about the page which is the contxt for the currently running code.
</p>
</div>
</div>
<h3>The .Id attribute:</h3>
The id of the current site is (this is the same as <code>TabId</code> in DNN or <code>Page.PageId</code> in oqtane.):
<strong>
@CmsContext.Page.Id
</strong>
<h3>Access all parameters with .Parameters:</h3>
Use this to get a string which contains all url parameters:
<strong>
@CmsContext.Page.Parameters.ToString()
</strong>>
<h3>Access a specific parameter with .Parameters:</h3>
Use this to access the value of a specific url parameter:
<strong>
@CmsContext.Page.Parameters["c140"]
</strong>
@* Footer *@
@Html.Partial("../Shared/Layout/FooterWithSource.cshtml", new { Sys = Sys })