Copied to clipboard

Flag this post as spam?

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


  • pubudu 30 posts 133 karma points
    Apr 25, 2019 @ 11:15
    pubudu
    0

    'CurrentPage' does not exist in the current context

    How fix this issue?

    enter image description here

  • Alex Skrypnyk 6087 posts 23490 karma points MVP 7x admin c-trib
    Apr 25, 2019 @ 12:55
    Alex Skrypnyk
    2

    Use this:

    var currentPage = Umbraco.AssignedContentItem;
    
  • Rhys Hamilton 140 posts 942 karma points
    Apr 25, 2019 @ 13:05
    Rhys Hamilton
    1

    You could simply use Model.Children()instead of CurrentPage.Children().

  • Carlos Gomes 38 posts 184 karma points
    Apr 25, 2019 @ 13:06
    Carlos Gomes
    2

    Hi pubudu,

    The dynamics were deprecated in v8. Use Model.Children() instead.

    Thanks,

  • pubudu 30 posts 133 karma points
    Apr 26, 2019 @ 03:27
    pubudu
    0

    Thanks Everyone!! After i use " Model.Children() " it make this. I should Change Any words here? enter image description here

  • Jonathan Distenfeld 105 posts 618 karma points
    Apr 26, 2019 @ 05:56
    Jonathan Distenfeld
    2

    Try adding this line at the top of your News.cshtml:

    @inherits UmbracoViewPage
    

    or, if you have a model in this view, try this;

    @inherits UmbracoViewPage<SomeModel>
    

    If that doesn't work for you, please provide a snippet of your News.cshtml - Especially the "model" or "inherits" Part.

    Jonathan

  • Rhys Hamilton 140 posts 942 karma points
    Apr 26, 2019 @ 08:35
    Rhys Hamilton
    2

    In your webbaseTemplate.cshtml layout, just double-check that you're using @inherits Umbraco.Web.Mvc.UmbracoViewPage at the top of the page, instead of @inherits WebViewPage.

  • pubudu 30 posts 133 karma points
    Apr 26, 2019 @ 08:51
    pubudu
    0

    Thanks Rhys!! Yes i use that.

  • pubudu 30 posts 133 karma points
    Apr 26, 2019 @ 08:53
    pubudu
    2

    Thanks Jonathan!! It Work. There are many changes in some words in Umbraco7 & Umbraco8 :( :(

  • Jonathan Distenfeld 105 posts 618 karma points
    Apr 26, 2019 @ 09:44
    Jonathan Distenfeld
    1

    Hi Pubudu,

    glad to hear it worked!

    Would you mind to mark the answer that helped you solving the problem as solution to help others having the same problem?

    Cheers, Jonathan

Please Sign in or register to post replies

Write your reply to:

Draft