Web部件自定义属性未显示

时间:2010-06-11 06:40:33

标签: sharepoint properties web-parts

我正在尝试为我的Web部件创建自定义属性,但无法让它显示在Sharepoint中。这是我目前的代码:

[Serializable]
[XmlRoot(Namespace = "MyWebPart")]
[DefaultProperty("Text")]
public class MyWebPart : WebPart
{
    ...
    [Category("My Web Parts Properties")]
    [DefaultValue(defaultPropertyValue)]
    [WebPartStorage(Storage.Shared)]
    [FriendlyNameAttribute("Property name")]
    [Description("Longer desc for my property")]
    [Browsable(true)]
    [XmlElement(ElementName = "SomeProperty")]
    public string SomeProperty
    {
        get { return someProperty; }
        set { someProperty = value; }
    }

是否还需要其他东西来使自定义属性工作?

1 个答案:

答案 0 :(得分:2)