SPWeb.Properties or SPWeb.AllProperties

I’ve just tested the new <PropertyBag> Caml tag available in SharePoint 2010 as illustrated below :

image

But again, as in SharePoint 2010, I’ve forgotten that if you try to grab the value from the SPWeb.Properties collection (in my specific case web.properties[“myCustomproperty”] , you will get null as the key name must fully be lowercase.

The recommendation is to use the SPWeb.AllProperties collection :

web.AllProperties[myCustomproperty] (this works with uppercase characters).

The recommendation is to use AllProperties (Properties is still kept for compatibility).

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s