1

I'm trying to create a custom property for my web part, but can't get it to show up in Sharepoint. Here's my current code :

[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; }
    }

Is there something else required to get custom properties working?

Morri
  • 571
  • 5
  • 20

1 Answers1

2

I think you're using the wrong properties

SO - Sharepoint custom web part property does not show up in the toolbox

Community
  • 1
  • 1
Ryan
  • 23,871
  • 24
  • 86
  • 132