Reading SPWeb Properties

Scenario:
Read Webproperties of a feature.xml.

Implementation:
In feature.xml under <Feature><Properties> tag use the below...

<Property Key="someKey" Value="true" />

From class file read the property value as below...

SPWeb web = SPContext.Current.Site.RootWeb;
if (web.Properties["someKey"] != null)
{
// web.Properties["someKey"] // Gives the value
}

Comments