我正在尝试为我的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; }
}
是否还需要其他东西来使自定义属性工作?
答案 0 :(得分:2)