【发布时间】:2011-08-08 16:39:57
【问题描述】:
我正在使用安装了 SharePoint powertools 的 Visual Studio 2010 中的 SharePoint 2010 开发沙盒可视化 Web 部件。 Web 部件按预期进行部署和工作,但属性不可编辑。我认为核心问题是 WebPartStorageAttribute 在沙盒中不可用,但无法找到有关如何创建具有可编辑属性的沙盒 Web 部件的指导。这甚至可能吗?
[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;
}
}
...
上面的代码有什么遗漏吗?是否可以创建可编辑的沙盒 Web 部件,如果可以,它是如何完成的?
【问题讨论】:
标签: .net sharepoint-2010 web-parts sandbox