【发布时间】:2015-07-31 21:41:24
【问题描述】:
我的代码中有一个函数可以在 SSRS 中打开各种报告,它可能需要也可能不需要接受参数。我传递的 URL 和参数如下:
var reportUrl = ConfigurationManager.AppSettings["ReportServerUrl"];
var reportPathComponents = ConfigurationManager.AppSettings["ReportPath"].Split(';');
var reportPath = string.Join("&", reportPathComponents);
return reportUrl + string.Format(reportPath, start.ToShortDateString(), end.ToShortDateString());
可能的输入是:
reportUrl = "http://ssrs14devreports..." ReportPath = "Report;rs:Command=Render;start={0};end={1}"
这在 IE 11 中运行良好,但在最新的 Chrome 和 FireFox 浏览器中,它将“&”编码为“&-amp;”。请原谅“&-amp;”中的 -。
【问题讨论】:
标签: c# .net asp.net-mvc url