是否可以在 SharePoint 中以编程方式将 Bamboo Web 部件添加到 Web 部件页面?
根本找不到关于如何执行此操作的太多信息 - 如何添加 Web 部件,然后为其配置设置?
Can't find much information on how to do this at all - how can I add in a web part and then configure the settings for it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是一个可以为您完成此操作的代码片段。在此示例中,我在页面上放置了一个内容编辑器 Web 部件,并以编程方式设置其内容。如果您想了解您的 Web 部件具有哪些属性,您可以手动将其放在页面上并将其导出。检查导出文件中的属性名称。
在您的情况下,必须引用第 3 方 DLL,并使用所需 Web 部件上的名称而不是
ContentEditorWebPart
。您可以使用对象浏览器
或Reflector找到名称。希望这有帮助。
Here's a code snippet that will do that for you. In this example, I put a Content Editor Web Part on the page and set the content of it programmatically. If you want to find out what properties your web part has, you can manually put it on a page and export it. Examine the exported file for the property names.
In your case, must must reference the 3rd party DLL, and use the name on the desired web part instead of the
ContentEditorWebPart
. You can find out the name by either using theObject Browser
or Reflector.Hope this helps.