Interviews3 answers
What is a SPSite and SPWeb object, and what is the difference between each of the objects?
3 Answers
SPSITE is sitecollection, SPWEB is subsite
Site collection: http://india.com/sites/Karnataka
sub site http://india.com/sites/Karnataka/bangalore
Lakku BramhendraPosted Feb 2, 2018, 5:49 AM EST
The SPSite is a Class which represents a collection of sites and SpWeb is a class which represents a web or subsites.
A SPSite class contains the various subsites and the information regarding them.
Gaurav GuptaPosted Jan 9, 2018, 2:09 AM EST
The SPSite object represents a collection of sites, i.e. Site Collection, a top level site and all its sub sites.
- It is used to get a sub site of a Site Collection.
- It is represented within an SPSiteCollection object that consists of the collection of all site collections in the Web application.
- It contains the various subsites and the information regarding them.
SPWeb:
- The SPWeb object represents an instance of a SharePoint Web, and the SPWeb object contains things like the actual content.
- It represents a SharePoint Foundation website.
- SPWeb object automatically adds the new SPWeb object to an internal list.
- It contains things like the actual content.
Rajkiran SwainPosted May 9, 2017, 11:11 PM EDT


