如何在 SharePoint 中查找 Web 部件的 ID?
我有一个 Web 部件,可将首选项保存到外部数据库,因为它们由外部程序使用。首选项的关键字段之一是 Web 部件的 ID,因此每个 Web 部件实例可以具有单独的首选项。
我正在测试场中解决一个问题,其中一组首选项会在 SharePoint 页面上生成错误,并且我需要检查该 Web 部件实例的首选项值。我没有在编辑器中公开 Web 部件的 ID。因此,现在我可以在数据库中看到 ID,但我不知道它属于哪个 Web 部件实例。
有没有一种方法可以找到 Web 部件的 ID,而无需修改代码来公开它并重新部署解决方案?
I have a web part that saves preferences to an external database because they are used by an outside program. One of the key fields for the preferences is the ID of the web part so each web part instance can have separate preferences.
I'm working on an issue in the test farm with a set of preferences that generate an error on the SharePoint page and I need to check the values of the preferences for that web part instance. I didn't expose the ID of the web part in the editor. So, now I can see the ID in the database but I don't know to which web part instance it belongs.
Is there a way to find the ID of a web part without having to modify the code to expose it and redeploy the solution?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
启动 Toolpart(修改共享 Web 部件),然后右键单击 >查看源代码。
搜索
并找到您的 Web 部件的 ID (Microsoft.SharePoint.WebPartPages.WebPart.ID)
使用 WSS3 (SharePoint 2007) 和 SharePoint Foundation 2010 进行测试。
Get up the Toolpart (Modify Shared Web Part) then Right Click > View Source.
Do a search for
and there is the ID of your web part (Microsoft.SharePoint.WebPartPages.WebPart.ID)
Tested with WSS3 (SharePoint 2007) and SharePoint Foundation 2010.
您可以在 SharePoint Designer 中打开 Web 部件页面并在那里查看它
You can probably open the web part page in SharePoint Designer and see it there