Diference between SPSite and SPWeb

SPSite
SPWeb
It is a Site Collection including top level site.
It is a specific website under Site Collection. It could be individual sub site or top level site.
SPSite is container that contains a single SPWeb (ex: SPSite.RootWeb), Top level site is referred as root web.

To return the current site collection use :
SPSite site = SPContext.Current.Site
To return the web site:
SPWeb web = SPContext.Current.Web
Few methods are  Dispose(), Close(), Delete(), GetChanges(), GetUrls() etc.
Few methods are Delete(),Dispose(), GetList(), GetListFromUrl() etc.

Comments

Popular posts from this blog

WCF interview questions

The term 'Connect-MsolService' is not recognized as the name of a cmdlet, function, script file, or operable program

what is Event Cache table in sharepoint