Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 688
George2 Avatar asked Jan 04 '10 15:01

George2


People also ask

How do I setup a content search Webpart in SharePoint online?

Go to the page that contains the CSWP that you want to edit. , select Edit Page. In the Web Part, select the Content Search Web Part Menu arrow > Edit Web Part. In the Web Part tool pane, in the Properties section, in the Search Criteria section, select Change query.


2 Answers

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.

like image 172
Muad'Dib Avatar answered Oct 20 '22 09:10

Muad'Dib


Check and see of this helps

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

like image 26
Shoban Avatar answered Oct 20 '22 09:10

Shoban