Difference between Response.Redirect(), Server.Transfer(), Response.RedirectPermanent()?

Posted by Shreedar under ASP.NET on 8/17/2015 | Points: 10 | Views : 612 | Status : [Member] | Replies : 3
When to use which method, what actually the difference among those three.

Regards

Sridhar Thota.
www.dotnet-sridhar.blogspot.com



Responses

Posted by: Bandi on: 8/18/2015 [Member] [MVP] Platinum | Points: 25

Up
0
Down
refer
http://www.codeproject.com/Tips/42264/Comparision-between-Response-Redirect-Response-Red

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Shreedar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sheonarayan on: 8/18/2015 [Administrator] HonoraryPlatinum | Points: 25

Up
0
Down
Here is the brief description of the differences

Response.Redirect - Use it to redirect the user from one page to another page temporarily.

Server.Transfer - Use it in case you want user to send to another page but do not want them to see the url change in the browser. Also, in this way you can access the value of previous page by using PreviousPage property.

Response.RedirectPermanent - Use it to let the search engines know that your current page is no more valid and you want this page to be treated as deleted and instead you want the redirected page to be indexed.

For more detailed explanations, please visit below website from DotNetFunda.com website itself

http://www.dotnetfunda.com/forums/show/8317/what-is-the-difference-beween-responseredirect-and-servertransfer
http://www.dotnetfunda.com/articles/show/164/difference-between-servertransfer-vs-responseredirect
http://www.dotnetfunda.com/interviews/show/3866/what-is-difference-between-responseredirect-and-servertransfer

Regards,
Sheo Narayan
http://www.dotnetfunda.com

Shreedar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Samirbhogayta on: 9/15/2015 [Member] Starter | Points: 25

Up
0
Down
Both Response.Redirect and Server.Transfer methods are used to transfer a user from one web page to another web page. Both methods are used for the same purpose, but still there are some differences as follows.

The Response.Redirect method redirects a request to a new URL and specifies the new URL while the Server.Transfer method for the current request, terminates execution of the current page and starts execution of a new page using the specified URL path of the page.

Both Response.Redirect and Server.Transfer have the same syntax like:
Response.Redirect("UserDetail.aspx");
Server.Transfer("UserDetail.aspx");

SAMIR
Sr. Software Engineer

Shreedar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response