views:

106

answers:

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?

+1  A: 

I think you're using the wrong properties

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

Ryan