I'm trying to create an SP2010 Sandboxed solution which involves a site collection administrator storing a piece of information in the Site collection root web property bag.

I can't think of a way I can do this as application pages aren't allowed and site pages cannot use code behind...

Is there another method that can be used to either

a) save data to spweb property bag or

b) store global data that can be used throughout the site?

3 Answers 3


Create a plain ol Web Part that stores the info in the appropriate location (property bags, custom list etc).


Looks like you can also use SharePoint Designer to set property bag values.

  1. Open a site
  2. Click Site -> Site Settings
  3. Click the Parameters tab
  • Yet another really useful feature in SPD. Pity it sucks for code editing.
    – James Love
    Aug 15, 2011 at 17:59
  • And that's also a problem! Do not ever store sensitive information in the property bags. And if you use values from the property bags make sure that you have propertly error handling, since you never know what your users are up to... Aug 16, 2011 at 8:14

You should use SPWeb.GetProperty, SPWeb.SetProperty, SPWeb.AddProperty, instead of SPWeb.Properties. SPWeb.Properties is not supported in sandbox. Also, if you call SPWeb.Properties.Update(), it will fail, so do SPWeb.Update()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.