Tuesday, November 9, 2010

difference between server.transfer and response.redirect

Both Respone.Redirect and Server.Transfer open up another page, but the interaction between client(browser) and server(asp.net) differs in each situation.

Resonse.Redirect simply tell the browser to visit another page.
Its the reponsibility of the browser to open up the another page.
External sites can be opened.

Server.Transfer works for only sites which runs on the server.
External sites cannot be opened.
Sharing states between pages is much easier using Server.Transfer.
Server.Transfer keeps the URL the same. This may lead to confusion.

No comments: