不使用 Sharepoint Designer 创建 XSLT 数据视图表单 Web 部件
Sharepoint Designer 有一项功能,允许您将 Web 部件列表转换为 XSLT 数据视图(右键单击 SPD 中的 Web 部件,然后单击“转换为 XSLT 数据视图”)。我需要能够模仿通过此过程创建的控件(据我所知它应该是 Microsoft.Sharepoint.WebPartPages.DataFormWebPart)。我的主机不允许使用 SPD,因此此 Web 部件必须是开箱即用的或捆绑到 WSP 中。不幸的是我没有找到办法做到这一点。
我尝试过的事情:
将 Web 部件另存为 SPD 中的 .webpart,然后将其部署为自定义 Web 部件。尝试将 Web 部件添加到我的网站时出现错误“类型未找到或不安全”(类似情况)。 Microsoft.Sharepoint.WebPartPages.DataFormWebPart 不安全?
通过浏览器创建 DataViewForm Web 部件,并添加与使用 SPD 转换的 Web 部件一起存储的相同 XSLT/参数代码。添加代码似乎没有效果(没有任何反应)。
出于测试目的,我使用 SPD 将列表 Web 部件转换为 XSLT 数据视图,然后通过浏览器修改 XSLT/参数代码,看看会发生什么,效果很好。我认为这至少给出了这样的线索:粘贴这样的代码应该可以工作。
我的目标是能够创建一个与此类似的菜单系统(使用 spd 来创建它): http://blog.pathtosharepoint.com/2009/01/15 /a-drop-down-menu-the-sharepoint-way/
With Sharepoint Designer there is a feature that allows you to convert a web part list to an XSLT Data View (right click on the web part in SPD and click 'Convert to XSLT Data View'). I need to be able to mimic the control that is being created with this process (from what I can tell it should be Microsoft.Sharepoint.WebPartPages.DataFormWebPart). My host does not allow the use of SPD, so this webpart must either be out-of-the-box or bundled into a WSP. Unfortunately I am not finding a way to do this.
Things I have tried:
Saving the web part as a .webpart in SPD then deploying it as a custom web part. I get an error when attempting to add the web part to my site 'Type not found or is not safe' (something like that). The Microsoft.Sharepoint.WebPartPages.DataFormWebPart is not safe?
Creating a DataViewForm web part through the browser and adding the same XSLT/Parameter code that is stored with the web part converted using SPD. Adding the code does not appear to have an effect (nothing happens).
For testing purposes I converted a list web part to an XSLT Data View using SPD, then modified the XSLT/Parameter code through the browser just to see what would happen, and it worked fine. I think that at least gives a clue that the pasting in the code like this should work..
My goal is to be able to create a menu system similar to this (which uses spd to create it): http://blog.pathtosharepoint.com/2009/01/15/a-drop-down-menu-the-sharepoint-way/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看看这里发布的文章: http://tjassens.com/?p=37 这描述了如何以编程方式使用多个数据源 (SPList) 制作 xslt 数据表单/数据视图 Web 部件,以及如何将参数动态传递到网页。
look at the article posted here: http://tjassens.com/?p=37 This describes how to make a xslt dataform/dataview webpart programmatically with multiple datasources (SPLists) and also how to pass parameters dynamically to the webpage..