SharePoint Web 部件存储在同一页面上具有多个 Web 部件实例
我已经构建了一个自定义 Web 部件,我试图将其三个实例放置在单个页面上。我注意到,当页面上只有一个实例时,自定义属性会保存并正常工作。然后,当我向页面添加同一自定义 Web 部件的另外两个实例时,以下 Web 部件不会保存其自定义属性值。我认为在 WebPartStorage 属性方面我一定做错了什么。有什么想法吗?
[Browsable(true), Category("Miscellaneous"),
WebPartStorage(Storage.Personal),
FriendlyName("List"), Description("List")]
public String List { get; set; }
I have a custom web part I've built, that I'm attempting to place three instances of on a single page. What I've noticed is that when I have a single instance on the page, the custom properties save and work appropriately. When I then add two more instances of the same custom web part to the page, the following web parts do not save their custom property values. I figure I must be doing something wrong when it comes to the WebPartStorage attribute. Any thoughts?
[Browsable(true), Category("Miscellaneous"),
WebPartStorage(Storage.Personal),
FriendlyName("List"), Description("List")]
public String List { get; set; }
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否尝试过 Storage.Shared 而不是 Storage.Personal?
这将有助于找出导致问题的个性化商店。
另外尝试删除FriendlyName 和Description 属性。
Have you tried Storage.Shared rather than Storage.Personal?
This would help to isolate the personalisation store as the cause of the problem.
Additionally try removing the FriendlyName and Description attributes.
有趣的是,我最终删除了默认值和描述属性,我的场景开始工作。我知道这不是一个很有帮助的解释,但也许它将来会对其他人有所帮助。
Interestingly enough, I ended up removing the default value and description attributes and my scenario began working. Not a very helpful explanation, I know, but maybe it will help someone else in the future.