Get information about the page which is the contxt for the currently running code.
On the new RazorTyped
it's on MyPage
or on MyContext.Page
.
⬇️ Result | Source ➡️
-
.Id
of the current page:
1193
(TabId
in DNN or
Page.PageId
in oqtane.)
-
.Url
the page url with protocol:
https://2sxc.org/dnn-tutorials/en/razor
-
.Parameters
all the url parameters of the page
koi110=page&tut=code-context
-
.Parameters[name]
Access a specific parameter
(in this case the parameter c140
from the url)
@inherits Custom.Hybrid.RazorTyped
@using ToSic.Razor.Blade
<ol>
<li>
<code>.Id</code> of the current page:
<strong>@MyPage.Id</strong>
(<code>TabId</code> in DNN or
<code>Page.PageId</code> in oqtane.)
</li>
<li>
<code>.Url</code> the page url with protocol:
<strong>@MyPage.Url</strong>
</li>
<li>
<code>.Parameters</code> all the url parameters of the page
<code>@MyPage.Parameters</code>
</li>
<li>
<code>.Parameters[name]</code> Access a specific parameter
(in this case the parameter <code>c140</code> from the url)
<strong>
@MyPage.Parameters["c140"]
</strong>
</li>
</ol>