Go to DotNetFunda.com
 Online : 689 |  Welcome, Guest!   Login
 
Home > Articles > ASP.NET > Difference Between Server.Transfer vs Response.Redirect

Submit Article | Articles Home | Search Articles |

Difference Between Server.Transfer vs Response.Redirect

red flag  Posted on: 10/19/2008 11:18:09 PM by Manisky2000 | Views: 6084 | Category: ASP.NET | Level: Beginner


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

Download


 Download source code for Difference Between Server.Transfer vs Response.Redirect



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.


If you like this article, subscribe to our RSS Feed. You can also subscribe via email to our Interview Questions, Codes and Forums section.

Found interesting? Add this to:

| More



Please Sign In to vote for this post.

 
Latest post(s) from Manisky2000

Latest Articles
Experience:3 year(s)
Home page:
Member since:Monday, October 13, 2008
Level:Starter
Status: [Member]
Biography:

Submit Article

About Us | The Team | Advertise | Contact Us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you found plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 9/3/2010 3:59:12 AM