This topic has not yet been rated - Rate this topic

SPWeb.Properties Property

Gets a SPPropertyBag object with the metadata for the website.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
[SubsetCallableExcludeMemberAttribute(SubsetCallableExcludeMemberType.UnsupportedSPType)]
public SPPropertyBag Properties { get; }

Property Value

Type: Microsoft.SharePoint.Utilities.SPPropertyBag
An SPPropertyBag object that contains the properties settings.

This property returns only a subset of the metadata for a website. To get all the metadata, use the AllProperties property.

The following example is a console application that accesses the Properties property, iterates through the collection, and prints each key/value pair to the console.

using System;
using System.Collections;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Utilities;

namespace Test
{
    class Program
    {
        static void Main(string[] args)
        {
            using (SPSite site = new SPSite("http://localhost"))
            {
                using (SPWeb web = site.OpenWeb())
                {
                    SPPropertyBag props = web.Properties;
                    foreach (DictionaryEntry de in props)
                    {
                        Console.WriteLine("Key = {0}, Value = {1}", de.Key, de.Value);
                    }
                }
            }
            Console.ReadLine();
        }
    }
}

The output that this application prints to the console varies with the website, but it might look like the following:

Key = vti_associatemembergroup, Value = 5
Key = vti_extenderversion, Value = 14.0.0.4016
Key = vti_associatevisitorgroup, Value = 4
Key = vti_associategroups, Value = 5;4;3
Key = vti_createdassociategroups, Value = 3;4;5
Key = vti_siteusagetotalbandwidth, Value = 547
Key = vti_siteusagetotalvisits, Value = 9
Key = vti_associateownergroup, Value = 3
Key = vti_defaultlanguage, Value = en-us

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Property deprecated?
I believe this property is deprecated (even though it is not indicated as such). The AllProperties Hashtable was intended to replace this.
What is in the subset?
It would be great if the documentation would specify what the subset of data is and clarify when to use Properties vs. AllProperties.