Response.Redirect VS Response.RedirectLocation

Discussion in 'ASP .Net' started by cmay, Jun 1, 2007.

  1. cmay

    cmay Guest

    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();
     
    cmay, Jun 1, 2007
    #1
    1. Advertising

  2. cmay

    Damien Guest

    On Jun 1, 3:46 am, cmay <> wrote:
    > 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
     
    Damien, Jun 1, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Charles A. Lackman
    Replies:
    2
    Views:
    8,030
    Charles A. Lackman
    Jan 11, 2006
  2. Matthew Wieder

    Response.Write and Response.Redirect

    Matthew Wieder, Jul 17, 2003, in forum: ASP .Net
    Replies:
    4
    Views:
    714
    Kevin Spencer
    Jul 17, 2003
  3. =?Utf-8?B?VHJveQ==?=

    Response.redirect does not redirect from .aspx page

    =?Utf-8?B?VHJveQ==?=, Oct 18, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    5,273
    Srowe1975
    Oct 15, 2008
  4. Sal
    Replies:
    1
    Views:
    678
  5. Ron Howard
    Replies:
    2
    Views:
    530
    Ron Howard
    Aug 11, 2004
Loading...

Share This Page