How do I make a webpart's settings configurable in Sharepoint?
Asked Answered
M

2

9

I am using SharePoint Server 2007 Enterprise with Windows Server 2008 Enterprise. I am publishing a portal template.

I want to develop a WebPart and make some settings configurable (just like we can configure parameters for a console application in app.config)

For example, authorized users could set parameters of WebPart in Edit Page (from browser based UI interface), then Select -> Modify WebPart properties, or edit parameters in SharePoint Designer.

The parameters would be application specific parameters.

How do I go about doing this?

Melindamelinde answered 4/1, 2010 at 15:13 Comment(0)
M
12

You can make your properties on the webpart and add attributes like so....

[WebBrowsable(true),Category("Calendar Setup"),
 WebDisplayName("Starting Date Column"),
 WebDescription("column that contains item starting date"),
 Personalizable(PersonalizationScope.Shared)]
public DateTime StartDate { get; set; }

You should check here for a full list and a good article on the subject.

Mccrory answered 4/1, 2010 at 15:25 Comment(0)
O
1

Check and see of this helps

Writing custom editors for Sharepoint 2007 and ASP.NET 2.0 WebParts

Ozone answered 4/1, 2010 at 15:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.