简体   繁体   中英

Response.Redirect with Different Referrer

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

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.

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM