I am developing a sandboxed visual webpart using SharePoint 2010 in Visual Studio 2010 with the SharePoint powertools installed. The webpart deploys and works as expected, except that the properties are not editable. I believe that the core problem is that WebPartStorageAttribute is not available in sandbox, but haven't been able to find guidance on how to create a sandboxed webpart with editable properties. Is this even possible?
[ToolboxItem(false)]
[XmlRoot(Namespace="MyNamespace")]
public partial class MyWebPart: System.Web.UI.WebControls.WebParts.WebPart
{
const string defaultStartTime = "00:30:00";
private string _startTime = "00:30:00";
[Browsable(true)]
[WebBrowsable(true)]
[Category("Timer")]
[Description("Start time to use if the user has not set a different one.")]
[XmlElement(ElementName="StartTime")]
[DefaultValue(defaultStartTime)]
[FriendlyName("Start Time")]
public string StartTime
{
get
{
return _startTime;
}
set
{
_startTime = value;
}
}
...
Is there something missing in the above code? Is it possible to create an editable sandboxed webpart, and if so, how is it done?