Sunday, August 23, 2009

Sharepoint PropertyBag

Sharepoint comes with handfull of option to store the information with ease.When we are thinking about storing configuration information then first item comes to our mind is web.config.But when we look at sharepoint perspective, there is one more usfull option called propertybag is available.It can store the information at different levels such as


• Farm
• Server
• Web Application
• Site Collection
• Site
• List
So we can share the information across different web where a list failed to do that and also able to persist information across farm.

SPWeb exposes two properties to store the information one is AllProperties which equivalent to a hashtable and supports case sensitive keys.Second one is properties (PropertyBag) and no supports for case sensitive keys.
using (SPSite site = new SPSite(SPContext.Current.Web.Url))
{
using (SPWeb web= site.OpenWeb()) {
// Add a property entry
web.Properties[key] = value;
web.AllProperties[key] = value;
web.Update();
web.Properties.Update();

// Remove a property entry
web.AllProperties.Remove(key);
web.Properties[key] = null;
web.Update();
web.Properties.Update();
}
}
We can also serialize the object and store in the propertybags.Sounds cool !!
You can download Property bag settings from http://pbs.codeplex.com/ and more details about managing configuration information http://spg.codeplex.com/Wiki/View.aspx?title=Managing%20Application%20Configuration&referringTitle=Home

Tuesday, August 11, 2009

Disable IE Enhanced Security for Windows 2008

When you are using windows 2008 as your workstation, then IE Enhanced security will be a burden for you.You can easily disable this.

Step 1 : Go To Server Manager



step2 : Turn Off the Security