MOSS 过滤器 Web 部件无法与 & 一起使用查询字符串中的符号
我知道这是 URL 编码中相当常见的错误。我怀疑的问题是 MOSS 过滤器 Web 部件用于根据从过滤器 Web 部件传递给它的查询字符串参数来过滤数据视图 Web 部件结果。
当查询字符串包含 & 时(与号)符号数据视图 Web 部件无法显示任何结果,但不显示任何错误。
当我用 %26 替换下面查询字符串中的 & 符号时,我收到异常“输入字符串的格式不正确”
http://localhost/subsite/Pages/Test.aspx?SS=Test%20Governance%20&%20Directors 未导致错误,但传递到数据视图 Web 部件的过滤器 (SS) 未显示任何结果。
http://localhost/subsite/Pages/Test. aspx?SS=Test%20Governance%20%26%20Directors 替换 & with %26 会产生异常“输入字符串的格式不正确”
我们可以在过滤器 Web 部件的查询字符串中使用 & 符号吗?我读到消费者 Web 部件将其读取为传递给它的另一个参数,也许这就是问题所在?尽管我已将过滤器 Web 部件配置为仅传递第一个参数。
I know this is a fairly common error with URL encoding. The problem I suspect is the MOSS Filter webpart used to filter a dataview webparts results based on the querystring paramter passed to it from the Filter webpart.
When the query string contains an & (ampersand) symbol the dataview webpart is unable to display any results but does not display any errors.
When I replace the ampersand in the query string below with %26 then I get an exception 'Input string was not in a correct format'
http://localhost/subsite/Pages/Test.aspx?SS=Test%20Governance%20&%20Directors
no error caused but filter (SS) passed to the Data view webpart shows no results.
http://localhost/subsite/Pages/Test.aspx?SS=Test%20Governance%20%26%20Directors
replacing the & with %26 produces an exception 'Input string was not in a correct format' is thrown
Can we use the ampersand in the query string from a Filter webpart? I have read that the consumer webpart reads this as another parameter being passed to it, maybe that is the problem? Though I have configured the Filter webpart to only pass the first parameter.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
好吧,只是必须改变&到最后...
Well just had to change & to and in the end...
SP 的查询字符串 URL 筛选器 Web 部件中存在错误。
如果字段类型为“多行文本”并且值包含“&”,则查询字符串 URL 过滤器将不起作用特点。即使您将其编码为 %26。
将列类型更改为“单行文本”。看看这是否能神奇地解决您的问题。
There is a bug in SP's Query String URL Filter web part.
The Query String URL Filter will not work if the field Type is "Multiple Lines of Text" and the value includes the '&' character. Even if you encode it to %26.
Change the column type to "Single Line of Text". See if that magically solves your problem.
对于我来说,在 sharepoint 2010 sp1 8 月更新中使用查询字符串 (URL) 过滤器,bobince 的双 url 编码对我有用。谢谢 bob,我快要抓狂了
For me in sharepoint 2010 sp1 august updates with the query string (URL) filter, bobince's double url encode worked for me.. Thanks bob i was pulling my hair out
默认情况下,SharePoint 会将
&
编码为%26
(如果未编码),则将&
编码为%26
。还要将参数
&useFiltersInViewXml=1
添加到过滤器视图 URL。它应该适合你。By default SharePoint will encode
&
to%26
if not encoded then encode&
to%26
.Also add the parameter
&useFiltersInViewXml=1
to the filter view URL. It should work for you.