Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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?

share|improve this question
add comment

3 Answers 3

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

share|improve this answer
add comment

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
share|improve this answer
    
Yet another really useful feature in SPD. Pity it sucks for code editing. –  James Love Aug 15 '11 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... –  Wictor Wilen MCA MCM MVP Aug 16 '11 at 8:14
add comment

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()

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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