C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » ASP.NET/Web Applications »

Difference Between Server.Transfer vs Response.Redirect


Posted Date: 31 Oct 2008    Resource Type: Articles    Category: ASP.NET/Web Applications
Author: shekharMember Level: Gold    
Rating: 1 out of 5Points: 5



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.





Responses

Author: Bindu Bujji    31 Oct 2008Member Level: Gold   Points : 1
Hi Sekhar,
Can you please attach sample code about how i can able to access the previous page contents in the current using server.transfer method.

Thanks in advance
Bindu


Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Securing connection strings and making secure authentication method
Previous Resource: AJAX application for continuos Integration
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET/Web Applications


Post resources and earn money!
 
Related Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use