我们有一个在 2.0 框架上运行的旧 .net 站点。在这个站点中,有多个调用在需要时通过调用 response.redirect() 进行重定向。出于某种原因,我无法弄清楚 ` 字符已停止映射到根 - 并且实际上显示为路径的一部分。例如:
Response.Redirect("~/shopping/checkout_confirm.aspx?rc=" &
MyPayment.ResponseCode & "&rt=" & MyPayment.ResponseText)
现在最终尝试重定向到:
https://www.site.com/shopping/~/shopping/checkout_confirm.aspx?rc=3
我也尝试了以下方法,但没有运气:
Response.Redirect(Page.ResolveUrl("~/shopping/checkout_confirm.aspx?rc=" &
MyPayment.ResponseCode & "&rt=" & MyPayment.ResponseText))
在开发环境中运行时,url 映射正确......关于这个问题的原因/解决方法有什么想法吗?