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...






Forums » .NET » ASP.NET »

what is the Difference between


Posted Date: 07 Nov 2009      Posted By: Ali Mahran      Member Level: Bronze     Points: 1   Responses: 6



hi my friends,

i need to know what the difference between

Response.Redirect("");
Server.Transfer("");





Responses

Author: sri    07 Nov 2009Member Level: SilverRating: 2 out of 52 out of 5     Points: 2

Response.Redirect sends a message to the browser, telling it to move to another page.

Server.Transfer is similar in that it sends the user to another page


Thanks & Regards
sri



Author: krishnavenikaladi    07 Nov 2009Member Level: GoldRating: 4 out of 54 out of 54 out of 54 out of 5     Points: 6

server.transfer transfers page processing from one page directly to the next page without making round trip back to clients browser.
this provides faster response but can't update the clients url historylist.
response.transfer is used to redirect users browser to another page/site.this performs a round trip.this updates the clients url history list



Author: Deepika Haridas    07 Nov 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

Hello,

Response.Redirect performs a roundtrip to server which means when you re-direct the page your URL changes too. In server.transfer it transfers the contents of other page in same page and also URL doesn't change.

For example,
If you write
Response.Redirect("http://yahoo.com"); - This will re-direct to Yahoo site
whereas
Server.Transfer("http://yahoo.com"); - This line will give an error (As server.Transfer will only work in your application scope)



Thanks & Regards,
Deepika
Editor

If U want to shine like a SUN..First U have to burn like the SUN!!
Need a Guide? Join my mentor program..



Author: Shivraj Singh Rajawat    07 Nov 2009Member Level: BronzeRating: 2 out of 52 out of 5     Points: 2

Server.Transfer() does not change URL of the brower......


Author: Nikhil Gaur    07 Nov 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

Response.Redirect() will redirect you to your destination page and will change client browser address bar with new URL.

but Response.Transfer will only redirect you without changing the url at client browser. but remember if you use server.transfer two times continuously means first you use server.Transfer("default.aspx") and in default.aspx you use Response.Transfer("default2.aspx") then it will not show the initial url when you are in default2.aspx but it will show default.aspx.

Join this campus group
http://www.dotnetspider.com/sites/637/-ecb-aspdotnet.aspx

Thanks & Regards
NIks
My Software and Web Development Experience



Author: Bunty    09 Nov 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

Hi,

1>Response.redirect sends message to the browser saying it to move to some different page while Server.transfer does not send any message to the browser but rather redirects the uyser directly from the server itself.So in Server.transfer their is no round trip while Response.redirect has a round trip hence puts a load on the server.

2>Using Sever.transfer you cannot redirect to a different server itself while using Response.redirect you can redirect to a different server also.

3>With Server.transfer you can preserve your information.It has a parameter called as "preserve form",so the existing query string etc will be available in the calling page.This is not possible in Response.redirect.


Thanks & Regards
S.S.Bajoria



Post Reply
You must Sign In to post a response.
Next : How to display aspx page
Previous : Master Page
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use