Saturday, May 31, 2008

Add a Custom Property for a webpart

Declare a region called Web Part Properties and for each custom property, create an entry similar to the one below:

private string listName;
[Personalizable(PersonalizationScope.Shared),
WebDisplayName(true),
WebDisplayName("List Name"),
WebDescription("Set your list name you wish the webpart to read from"),
Category("Custom Settings")]
public string ListName
{
get{return listName;}
set{listName = value;}
}

No comments: