views:

834

answers:

3

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

A: 

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

Rowland Shaw
+4  A: 

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.

Recep
+1  A: 

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

Fabrizio C.