Discussion:
Response.Redirect VS Response.RedirectLocation
(too old to reply)
cmay
2007-06-01 02:46:14 UTC
Permalink
Does anyone know the difference between these two?

Response.Redirect( "http://site.com/newlink.aspx");

and

Response.RedirectLocation = "http://site.com/newlink.aspx";
Response.End();
Damien
2007-06-01 07:09:48 UTC
Permalink
Post by cmay
Does anyone know the difference between these two?
Response.Redirect( "http://site.com/newlink.aspx");
and
Response.RedirectLocation = "http://site.com/newlink.aspx";
Response.End();
A fair bit. RedirectLocation just sets the location header. Redirect
sets the header, sets the correct status code, includes a quick
snippet of HTML saying that the resource has moved.

For these sorts of questions, I'd recommend getting hold of Reflector.
It lets you see what's going on inside any code, and it's at my
favourite price (free). (Plus, I've found that the author, Lutz
Roeder, can be vary patient and helpful in explaining why problems I'm
seeing are because I've been such a numpty)

Damien

Loading...