Response.Redirect 使用不同的 Referrer
我在 aspx 网页中有以下代码段:
Response.Redirect("/Someurl/");
我还想发送一个带有重定向的不同引荐来源网址,例如:
Response.Redirect("/Someurl/", "/previousurl/?message=hello");
这在 Asp.net 中可能吗?还是引荐来源网址仅由浏览器处理?
干杯 斯蒂芬
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Referrer 是只读的,本来就是这样的。 我不知道你为什么需要它,但你可以发送查询变量,而不是
你可以调用
并获取你需要的东西,如果有帮助的话。
Referrer is readonly and meant to be that way. I do not know why you need that but you can send query variables as instead of
you can call
and get what you need there, if that helps.
Response.Redirect
向浏览器发送应答代码 (HTTP 302),浏览器又发出新请求(至少这是预期的行为)。 另一种可能性是使用 Server.Transfer(请参阅 此处)不会返回到浏览器。无论如何,他们都不能解决你的要求。 也许提供有关您的案例的更多详细信息可以帮助找到另一个解决方案。 ;-)
Response.Redirect
sends an answer code (HTTP 302) to the browser which in turn issues a new request (at least this is the expected behavior). Another possibility is to useServer.Transfer
(see here) which doesn't go back to the browser.Anyway, both of them don't solve your request. Perhaps giving some more detail on your case can help find another solution. ;-)
引荐来源网址仅来自客户端浏览器(这也可能对您撒谎)
The referrer comes solely from the client browser (which may be lying to you, too)