title: Welcome page of subsite - Sharepoint 2007
body: <p>How to extract url of Welcome page of subsite? </p>
  
  <p>I mean, I have sth like this</p>
  
  <pre><code>-SiteRoot
  --Pages
  ----Default.aspx         &lt;---------HERE I AM
  --Subsites
  ----SiteOne
  ------Pages
  --------Home.aspx        &lt;---------I NEED THIS
  ----SiteTwo
  ------Pages
  --------Home2.aspx       &lt;---------I NEED THIS
  </code></pre>
  
  <p>And I would like to get information about URL of landing pages of subsites</p>
  
  <p>Could you help me?</p>
  
  <p>I have wrote sth like this:</p>
  
  <pre><code>SPWeb web = SPContext.Current.Web;
  foreach (SPWeb w in web.Webs)
              {
                  MenuItem item = new MenuItem();
  
                  item.Url = w.RootFolder.WelcomePage;
                  item.Title = w.Title;
  
                  MenuItems.Add(item);
              }
  </code></pre>
  
  <p>But it takes welcome page of my Root folder, so Default.aspx</p>