Which object should you use?

You need to create a Web Part that will store and retrieve information for the current subsite.

Which object should you use?

You need to create a Web Part that will store and retrieve information for the current subsite.

Which object should you use?

A.
SPContext.Current.Site.RootWeb.AllProperties

B.
SPContext.Current.Site.RootWeb.Configuration

C.
SPContext.Current.Web.Configuration

D.
SPContext.Current.Web.Properties

Explanation:
MNEMONIC RULE: “information is in Web.Properties”

SPContext.Current.Web is SPWeb object.

Properties is the SPPropertyBag object with the metadata for the website.

SPWeb.Properties Property
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb.properties.aspx



Leave a Reply 0

Your email address will not be published. Required fields are marked *