Response.Redirect 使用不同的 Referrer

发布于 2024-07-11 03:28:00 字数 267 浏览 6 评论 0 原文

我在 aspx 网页中有以下代码段:

Response.Redirect("/Someurl/");

我还想发送一个带有重定向的不同引荐来源网址,例如:

Response.Redirect("/Someurl/", "/previousurl/?message=hello");

这在 Asp.net 中可能吗?还是引荐来源网址仅由浏览器处理?

干杯 斯蒂芬

I've got the following piece of code in an aspx webpage:

Response.Redirect("/Someurl/");

I also want to send a different referrer with the redirect something like:

Response.Redirect("/Someurl/", "/previousurl/?message=hello");

Is this possible in Asp.net or is the referrer handled solely by the browser?

Cheers
Stephen

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

梦过后 2024-07-18 03:28:00

Referrer 是只读的,本来就是这样的。 我不知道你为什么需要它,但你可以发送查询变量,而不是

Response.Redirect("/Someurl/");

你可以调用

Response.Redirect("/Someurl/?message=hello");

并获取你需要的东西,如果有帮助的话。

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

Response.Redirect("/Someurl/");

you can call

Response.Redirect("/Someurl/?message=hello");

and get what you need there, if that helps.

陪你搞怪i 2024-07-18 03:28:00

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 use Server.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. ;-)

拥抱我好吗 2024-07-18 03:28:00

引荐来源网址仅来自客户端浏览器(这也可能对您撒谎)

The referrer comes solely from the client browser (which may be lying to you, too)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文