Search code examples
c#asp.netresponse.redirectreferrerreferer

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


Solution

  • 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.