键/值自定义 webPart 属性 - Sharepoint 2010
找不到任何相关资源
我想向我的 visual webPart
添加自定义属性,添加属性的正常方法不适用于 Dictionary
的 type
[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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
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