Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Sunil 14 posts 84 karma points
    Feb 25, 2020 @ 13:34
    Sunil
    0

    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.

  • Joep 96 posts 698 karma points
    Feb 25, 2020 @ 14:09
    Joep
    100

    Hi,

    You can use var currentPage = Umbraco.AssignedContentItem; to get the current node.

    -Joep

  • 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.

Please Sign in or register to post replies