简体   繁体   English

如何在Sharepoint中配置webpart的设置?

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

I am using SharePoint Server 2007 Enterprise with Windows Server 2008 Enterprise. 我在Windows Server 2008 Enterprise中使用SharePoint Server 2007 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) 我想开发WebPart并使一些设置可配置(就像我们可以在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. 例如,授权用户可以在编辑页面中设置WebPart的参数(从基于浏览器的UI界面),然后Select -> Modify WebPart属性,或在SharePoint Designer中编辑参数。

The parameters would be application specific parameters. 参数将是特定于应用程序的参数。

How do I go about doing this? 我该怎么做呢?

You can make your properties on the webpart and add attributes like so.... 您可以在webpart上创建属性并添加类似的属性....

[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. 您应该在这里查看完整列表和关于该主题的好文章。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM