Illustrate the importance of Server.Transfer and Response.Redirect in .NET?

In your code when you are trying to redirect from the current page to a different page, then you will be using either Server.Transfer or Response.Redirect.




Purpose of each of them along with their differences is tabulated below:

Server.Transfer
Response.Redirect
When you want to move from the current page to a different page in the same website then you can use Server.Transfer. When you want to redirect from the current page to a page belonging to some other website then you can use Response.Redirect.
When you use Server.Transfer, the user will be redirected from the server directly to the other page. When you use Response.Redirect, a message will be sent to the browser requesting it to move to the different page.
This is advantageous because the user is directly transferred to the page. This has a considerable load on the server since it has a round trip due to sending message to browser and then browser loading the new page.
You cannot redirect the user to a different server using Server.Transfer. Response.Redirect gives you the facility to redirect to a different server.
If you use Server.Transfer, you can retain the existing data that you have entered in the current page using preserveForm parameter. You cannot retain data while using Response.Redirect.

_______________________________________________________________________

Add to My Yahoo!


FREE Subscription

Subscribe to our mailing list and receive new articles
through email. Keep yourself updated with latest
developments in the industry.

Name:
Email:

Note : We never rent, trade, or sell my email lists to
anyone. We assure that your privacy is respected
and protected.

Visit .NET Programming Tutorial Homepage

______________________________________________________

Recommended Resource

| How do you implement Observer Design Pattern in .NET? | How do you pass data between different Tiers in .NET Architecture? | How is Classic ADO different from ADO.NET? | How is Dataadapter useful in ADO.NET? | How is Datareader different from Dataset in ADO.NET? | How is .NET Application Development different from Traditional Development? | How is HashTable different from ArrayList in .NET? | How is Inheritance achieved in C#? | How is new keyword different from override keyword during inheritance in .NET? | How is String class different from StringBuilder class in .NET? | Illustrate ADO.NET Architecture | Illustrate the importance of Server.Transfer and Response.Redirect in .NET? | Mention the different objects available in Dataset of ADO.NET | Mention the usage of Connection Object in ADO.NET | What are the commonly used methods of Dataadapter in ADO.NET? | What are the different Behavioral Design Patterns that can be used in .NET Architecture? | What are the different Creational Design Patterns that can be used in .NET Architecture? | What are the different Structural Design Patterns that can be used in .NET Architecture? | What are the methods provided by Command Objects in ADO.NET? | What is Internal Access Modifier in C#? |


| Privacy Policy for www.dotnet-guide.com | Disclosure | Contact |

Copyright - © 2004 - 2017 - All Rights Reserved.