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 95 posts 697 karma points
    Feb 25, 2020 @ 14:09
    Joep
    100

    Hi,

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

    -Joep

Please Sign in or register to post replies

Write your reply to:

Draft