0

Right now my code gets the URL from my SPSite but I only want to get the Title

var url = portalUrl.Text;
if (SPSite.Exists(new Uri(url)))
{
    using (SPSite oSiteCollection = new SPSite(url))
    {

        SPSiteCollection collWebsite = oSiteCollection.WebApplication.Sites;


        foreach (SPSite site in collWebsite)
        {
            listboxLogging.Items.Add(SPEncode.HtmlEncode(site + Environment.NewLine));
        }


    }
}
Choggo
  • 1,709
  • 14
  • 22
Batistuta
  • 718
  • 1
  • 11
  • 38

1 Answers1

1

Only SPWeb has a title. You can get that from the context.

SPContext.Current.Web.Title
Nadeem Yousuf-AIS
  • 18,707
  • 4
  • 28
  • 59
jpollar
  • 1,127
  • 1
  • 7
  • 12