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
How fix this issue?
Use this:
var currentPage = Umbraco.AssignedContentItem;
You could simply use Model.Children()instead of CurrentPage.Children().
Model.Children()
CurrentPage.Children()
Hi pubudu,
The dynamics were deprecated in v8. Use Model.Children() instead.
Thanks,
Thanks Everyone!! After i use " Model.Children() " it make this. I should Change Any words here?
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
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.
webbaseTemplate.cshtml
@inherits Umbraco.Web.Mvc.UmbracoViewPage
@inherits WebViewPage
Thanks Rhys!! Yes i use that.
Thanks Jonathan!! It Work. There are many changes in some words in Umbraco7 & Umbraco8 :( :(
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
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
'CurrentPage' does not exist in the current context
How fix this issue?
Use this:
You could simply use
Model.Children()
instead ofCurrentPage.Children()
.Hi pubudu,
The dynamics were deprecated in v8. Use Model.Children() instead.
Thanks,
Thanks Everyone!! After i use " Model.Children() " it make this. I should Change Any words here?
Try adding this line at the top of your News.cshtml:
or, if you have a model in this view, try this;
If that doesn't work for you, please provide a snippet of your News.cshtml - Especially the "model" or "inherits" Part.
Jonathan
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
.Thanks Rhys!! Yes i use that.
Thanks Jonathan!! It Work. There are many changes in some words in Umbraco7 & Umbraco8 :( :(
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
is working on a reply...