Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi, i am writing code @{ var selection = CurrentPage.Ancestors(); } in a view(.cshtml) file and its saying "The name "CurrentPage" does not exists in current context. Please suggest.
@{ var selection = CurrentPage.Ancestors(); }
Hi,
You can use var currentPage = Umbraco.AssignedContentItem; to get the current node.
var currentPage = Umbraco.AssignedContentItem;
-Joep
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Error in accessing CurrentPage property in mvc view
Hi, i am writing code
@{ var selection = CurrentPage.Ancestors(); }
in a view(.cshtml) file and its saying "The name "CurrentPage" does not exists in current context. Please suggest.Hi,
You can use
var currentPage = Umbraco.AssignedContentItem;
to get the current node.-Joep
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.