波形符显示在 URL 中而不是映射到根目录
我们有一个在 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))
在开发环境中运行时,网址正确映射...您知道这个问题的原因/解决方法是什么吗?
We have a old .net site that runs on the 2.0 framework. In this site there are multiple calls that redirect when needed by calling response.redirect(). For some reason that I cannot figure out the ` character has stopped being mapped to the root - and is actualy showing as part of the path. For example:
Response.Redirect("~/shopping/checkout_confirm.aspx?rc=" &
MyPayment.ResponseCode & "&rt=" & MyPayment.ResponseText)
Now ends up trying to redirect to:
https://www.site.com/shopping/~/shopping/checkout_confirm.aspx?rc=3
I have tried the following aswell, with no luck:
Response.Redirect(Page.ResolveUrl("~/shopping/checkout_confirm.aspx?rc=" &
MyPayment.ResponseCode & "&rt=" & MyPayment.ResponseText))
When run in the dev environment the url maps correctly... Any idea's on what could be the cause / fix for this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
响应文本的一部分包含需要编码的字符。
Part of the ResponseText contained a character that needed to be encoded.
尝试使用相对路径:
Try using a relative path instead: