How to use Web Part Custom Properties in SharePoint 2007 and WSS 3.0

t’s so weird how so many people ask you the same thing around the same time sometimes, anyway I’ve had some request around on how to create custom properties for Web Parts in SharePoint, more to the point, on how to get them to categorise and appear in the “Modify Web Part” panel.

It’s quite simple actually, just declare the properties and decorate them with attributes like in the following example:



Category(“RSS Aggregator Web Part”),

DisplayName(“URLs of the Feed”),

WebDisplayName(“URLs of the Feed”),

Description(“Please enter the URLs of the feed separated by ‘;’ character.”)]

public string FeedURL




return rssUrl;




rssUrl = value;



Please note that Category attribute will basically create section for all your properties that carry that attribute value and WebDisplayName will be the name of the property appearing on the panel.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: