title: How Do I Get The Default/Welcome Page Of A SharePoint 2010 Site?
body: <p>I'm new to SharePoint 2010 coding web parts. I'm trying to figure out how to get the landing page of a SharePoint site given the URL.</p>
  
  <p>Ex. I give the function <a href="http://www.yahoo.com" rel="nofollow">http://www.yahoo.com</a> and I get <a href="http://www.yahoo.com/pages/default.aspx" rel="nofollow">http://www.yahoo.com/pages/default.aspx</a> .</p>
  
  <p>Here's the function so far:</p>
  
  <pre><code>private string GetSPSiteUrl(string u) {
      var siteurl = string.Empty;
  
      using (SPSite site = new SPSite(u)) {
          using (SPWeb web = site.OpenWeb()) {
              siteurl = web.Url;
          }
      }
  
      return siteurl;
  }
  </code></pre>
  
  <p>The function just returns what I give it now which is no use.</p>
  
  <p>Any help would be great. Thanks!</p>