将 XsltListViewWebPart 添加到站点定义主页
将 XsltListViewWebPart 添加到网站定义的 default.aspx 的最佳方法是什么?
我尝试通过从现有页面复制 XML 来以声明方式向定义的 default.aspx 添加一个,但有许多对查看和列出 guid 的引用,在配置站点之前我不会拥有这些引用。另一种方法是通过站点配置或功能激活的事件处理程序以编程方式添加到 default.aspx,但在创建站点之前无法获取对 default.aspx 的引用。
What's the best method for adding an XsltListViewWebPart to a site definition's default.aspx?
I've tried to add one to the definition's default.aspx declaratively by copying the XML from an existing page, but there are a number of references to view and list guids which I won't have until the site is provisioned. The alternative was to programmatically add to the default.aspx via a site provisioned or feature activated event handler, but it's impossible to get a reference to the default.aspx until the site has been created.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将如下 XML 添加到您的模块部分:
默认情况下,SharePoint 2010 将使用 XsltListViewWebPart。您仍然可以使用旧的 ListViewWebPart 和 XML,如下所示:
Add XML like this to your Module section:
SharePoint 2010 will use the XsltListViewWebPart by default. You can still use the old ListViewWebPart with XML as follows: