键/值自定义 webPart 属性 - Sharepoint 2010

发布于 2024-12-23 12:25:24 字数 324 浏览 1 评论 0原文

找不到任何相关资源
我想向我的 visual webPart 添加自定义属性,添加属性的正常方法不适用于 Dictionarytype

[Personalizable(), WebBrowsable(), WebDisplayName("News Sources"), WebDescription("description")]
public Dictionary<Guid,string> NewsSources { get; set; }

任何替代方法吗?

Couldn't find any related resources
I want to add a custom property to my visual webPart, the normal way of adding properties not working with type of Dictionary

[Personalizable(), WebBrowsable(), WebDisplayName("News Sources"), WebDescription("description")]
public Dictionary<Guid,string> NewsSources { get; set; }

any alternatives?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

扛刀软妹 2024-12-30 12:25:24

Dictionary 类型的属性无法添加到自定义 WebPart。

如果您希望将下拉列表作为属性,则后备存储必须为enum 类型

,请参阅:

使用自定义属性创建 Web 部件
http://msdn.microsoft.com/en-我们/library/dd584174(v=office.11​​).aspx

The property of type Dictionary cannot be added to Custom WebPart.

If you want to have the dropdown list as the property, the backing store must be of type enum

See:

Creating a Web Part with Custom Properties
http://msdn.microsoft.com/en-us/library/dd584174(v=office.11).aspx

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文