Sharepoint XSL 数据视图查询字符串过滤
假设我有一个名为事件的列表。
使用 SP Designer,我可以将 Web 部件添加到页面,选择事件列表,并且具有标准共享点控件和列筛选的数据网格将添加到页面,类似于任何列表的“allitems.aspx”视图。
列过滤的好处是它使用 GET 请求,使用查询字符串,例如:
?FilterField1=location&FilterValue1=usa&FilterField2=qtr&FilterValue2=q2
这允许我构造 url 并发送他们向人们展示预先过滤的数据。当不存在查询字符串时,将显示所有项目。
如何使用 xsl 数据视图实现此目的?对这些内容的过滤是通过 POST 请求完成的(即 URL 永远不会更改或附加查询字符串)。我知道我可以设置一个查询字符串参数,然后根据该参数进行过滤,但是如果查询字符串不存在,则不会显示任何项目,因为它始终在寻找查询字符串进行过滤。
有没有办法让 xsl 数据视图在 GET 请求模式下工作?
Lets say I have a list called events.
Using SP Designer I can add a webpart to a page, select the events list, and a data grid with standard sharepoint controls and column filtering will be added to the page, similar to the "allitems.aspx" view of any list.
The nice thing about the column filtering is that it uses GET requests, using query strings eg:
?FilterField1=location&FilterValue1=usa&FilterField2=qtr&FilterValue2=q2
This allows me to construct urls and send them to people, showing them pre filtered data. When no query strings are present, all items are displayed.
How can I achieve this with xsl data views? The filtering on these are done via POST requests (i.e. the URL never changes or gets query strings appended). I know I can set up a query string parameter and then filter on this parameter, but if the query string is not present, no items are display because it is always looking for the query string for filtering.
Is there any way to make an xsl data view work in a GET request mode?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,您可以做的就是添加一个条件是 xslt,如果存储查询字符串值的 xslt 参数为空,则显示所有结果,否则根据查询字符串的 xsl 参数对其进行过滤
yes you can what you can do is add a condition is xslt if your xslt parameters storing the querystring values are empty then show all results else filter it based upon the xsl parameters for query string