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.
Ex. I give the function http://www.yahoo.com and I get http://www.yahoo.com/pages/default.aspx .
Here's the function so far:
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;
}
The function just returns what I give it now which is no use.
Any help would be great. Thanks!