Go to DotNetFunda.com
 Online : 152 |  Welcome, Guest!   Login
 Skip Navigation Links Home > Articles > ASP.NET > Difference Between Server.Transfer vs Response.Redirect
  Win at least 8 gifts every month now! >> Top Performers of this month.   


Notice: If page content has been copied from other sources without proper permission, kindly let us know with details from where it has been copied for further action.

All Articles | Submit Article |

Difference Between Server.Transfer vs Response.Redirect

 Download source file
 Posted on: 10/19/2008 11:18:09 PM by Manisky2000 | Views: 2555 | Category: ASP.NET | Level: Beginner | Print Article
By the Following code sample attachement, This concept will be more understandable. Make use of it.

Webmaster says - If this article content has been copied from other websites without proper permission, kindly let us know with details from where it has been copied for further action.

Introduction
The data transfering between two page will be more differ on server.Transfer() and Response.Redirect().

Server.Transfer



Server.Transfer() helps the one less round trip. The main advantage of this transfer the first page to second page with better performance. The data can pass through variables, query string and also can retrive from the previous page control value.

Eg: Server.Transfer("Default.aspx");

Response.Redirect()


It is very similar to server.Transfer. The main difference is the posted pervious page values can't be accessable. Here also the data can pass through server variables and query string. It simply redirect the page from one page to another.

Eg: Response.Redirect("Default.aspx")

Note: But the pervious page values can't be accessable by Response.Redirect().

By the Following code setup attachement, This concept will be more understandable. Make use of it.

 

Default.aspx

Just adding required Controls.




Default.aspx.cs

Here, The Default page is transfer to Default2.aspx.


Default2.aspx.cs

If the pervious page is used Server.Transfer(), then this following code will find the Default page Control (txtSample).

Conclusion

By the way according to the requirement we can transfer one page to another page.

Formatting edited by: Webmaster on 20-Oct-2008.


Interesting?   Share and Bookmark this kick it on DotNetKicks.com


Experience:3 year(s)
Home page:
Member since:Monday, October 13, 2008
Biography:
 Latest post(s) from Manisky2000

   ◘ SQL Joins posted on 11/3/2008 11:53:37 PM
   ◘ Binding Dynamic Column in GridView posted on 10/21/2008 2:45:11 AM
   ◘ Difference Between Server.Transfer vs Response.Redirect posted on 10/19/2008 11:18:09 PM


Submit Article

About Us | The Team | Contact Us | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
All rights reserved to DotNetFunda.Com. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks.
(Best viewed in IE 6.0+ or Firefox 2.0+ at 1024 * 768 or higher)