In the web app (C#, ASP.NET) I am working on at the moment, the value in Request.Headers[“Referer”] can determine things like custom style. I have created a custom page with a drop down menu to test this functionality. So when the selected index changes, the value selected should be set in the Request.Headers[“Referer”] then will be redirected (Response.Redirect), the receiving page will then pick up the value in Request.Headers[“Referer”] and adjust the styling accordingly. However I haven’t been able to set value for Request.Headers[“Referer”]. Is it possible at all?
Website 1 sets the value in
Request.Headers[“Referer”], e.g.
http://www.xyz.com and before doing Response.Redirect
to http://www.website2.comWebsite 2 picks up value in
Request.Headers[“Referer”], in this
case http://www.xyz.com and do what it needs
to do, i.e. styling etc.
You can’t do this. The Request.Headers[“Referer”] value is a value sent by the browser on each request. It’s up to the browser what value it choose to supply for this value, and there is no means for a web page to send a response that says “for your next request, use this value for the Referer”. And when you do a Request.Redirect, you’re sending a response to the browser, telling it to make another request.
So whatever you’re trying to achieve, this attempted method is not going to be the way to do it.