Developer forum

Forum » Development » In cshtml, list all subpages based if they are published or not

In cshtml, list all subpages based if they are published or not

Andreas Hunderi
Reply

Hi
I'm using version 8.6.1.30
In my project I'm listing all subpages of a page in cshtml with a foreach loop using

 var reports = Pageview.Page.Children;
         @foreach (var report in reports)


Using this method the foreach loop list all the pages published and unpublished. Is there a way to check if the subpage is published or unpublished?
 


Replies

 
Andreas Hunderi
Reply

Figured it out using a if check with Dynamicweb.Frontend.Page.IsActive(report.ID)

 

You must be logged in to post in the forum