SharePoint Web 部件存储在同一页面上具有多个 Web 部件实例

发布于 2024-08-07 06:16:58 字数 349 浏览 2 评论 0原文

我已经构建了一个自定义 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 技术交流群。

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

发布评论

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

评论(2

清醇 2024-08-14 06:16:58

您是否尝试过 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.

秋日私语 2024-08-14 06:16:58

有趣的是,我最终删除了默认值和描述属性,我的场景开始工作。我知道这不是一个很有帮助的解释,但也许它将来会对其他人有所帮助。

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.

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