Web Parts custom property not showing up
Posted
by Morri
on Stack Overflow
See other posts from Stack Overflow
or by Morri
Published on 2010-06-11T06:40:32Z
Indexed on
2010/06/11
9:53 UTC
Read the original article
Hit count: 190
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?
© Stack Overflow or respective owner