SPWeb.Webs, Site vs SubSite

Posted by noob.spt on Stack Overflow See other posts from Stack Overflow or by noob.spt
Published on 2010-03-31T00:01:47Z Indexed on 2010/03/31 0:43 UTC
Read the original article Hit count: 445

Hi,

I have a very basic question here. I am confused between SPSite. SiteCollection and SPWeb.

So my understanding is (or what I could research on this) that,

http://My_server >>> TOP Level SIte or SPWEbApplication http://My_server/My_site >>>> Site Collection or SPSite

Now a site under SPSite that will be referenced through SPWeb. So what are we getting when using SPWeb.Webs. What is a Subsite?

Please let me know if I need to rephrase the question or more info is needed.

Thanks.

SPWeb mySite = SPContext.Current.Web;
SPWebCollection sites = mySite.Webs;

foreach (SPWeb subSite in sites)
{
    Response.Write(SPEncode.HtmlEncode(subSite.Title) + "<BR>");
}

© Stack Overflow or respective owner

Related posts about moss-2007

Related posts about sharepoint2007