title: EPiServer 7 GetChildren for a specific page. and list all under that page
body: <p>I'm having problems with EPiServer 7 trying to list childrens to a pagetype.</p>
  
  <p>What I want is to get a page reference for the current page. I tried using PageReference listRoot = 
  CurrentPage but it does not work.</p>
  
  <p>My code looks like this:</p>
  
  <pre><code>    private IEnumerable&lt;PageData&gt; getChildren(EducationPage CurrentPage)
      {
          IEnumerable&lt;PageData&gt; pages = new List&lt;PageData&gt;(); 
          PageReference listRoot = CurrentPage;
  
          pages = contentLoader.GetChildren&lt;PageData&gt;(listRoot).OfType&lt;PageData&gt;();
  
          return pages;
      }
  </code></pre>