Welcome to Sudeep Pandey

Just for sharing ideas and knowledge— My Blog

Archive for October 17th, 2008

Difference between Server.Transfer and Response.Redirect

Posted by Sudeep Pandey on October 17, 2008

Server.Transfer preserve the information and there is no roundtrip. It is used when you want to navigate within the same website.

E.g. Server.Transfer(“abc.aspx”);

If you want to navigate into different server then you can’t use Server.Transfer.  That is,

Server.Transfer(“http://www.google.com/”); gives the error .

For this, we have to use Response.Redirect where there is roundtrip but it doesn’t preserve the information. It sends message to the browser saying it to move to different page.

So in this case, we can do ,

Response.Redirect(“abc.aspx”);

Response.Redirect(“http://www.google.com/”);

Posted in ASP.NET | Leave a Comment »