This is a discussion on Difference between Server.Transfer and Response.Redirect within the ASP and ASP.NET Programming forums, part of the Web Development category; The difference between Server.Transfer and Response.Redirect Response.Redirect: This tells the browser that the requested page can be ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| The difference between Server.Transfer and Response.Redirect Response.Redirect: This tells the browser that the requested page can be found at a new location. The browser then initiates another request to the new page loading its contents in the browser. This results in two requests by the browser. Server.Transfer: It transfers execution from the first page to the second page on the server. As far as the browser client is concerned, it made one request and the initial page is the one responding with content. The benefit of this approach is one less round trip to the server from the client browser. Also, any posted form variables and query string parameters are available to the second page as well. |
| Sponsored Links |
| |||
| Hi, Server.Transfer() : client is shown as it is on the requesting page only, but the all the content is of the requested page. Data can be persist accros the pages using Context.Item collection, which is one of the best way to transfer data from one page to another keeping the page state alive. Response.Dedirect() :client know the physical loation (page name and query string as well). Context.Items loses the persisitance when nevigate to destination page. In earlier versions of IIS, if we wanted to send a user to a new Web page, the only option we had was Response.Redirect. While this method does accomplish our goal, it has several important drawbacks. The biggest problem is that this method causes each page to be treated as a separate transaction. Besides making it difficult to maintain your transactional integrity, Response.Redirect introduces some additional headaches. First, it prevents good encapsulation of code. Second, you lose access to all of the properties in the Request object. Sure, there are workarounds, but they’re difficult. Finally, Response.Redirect necessitates a round trip to the client, which, on high-volume sites, causes scalability problems. As you might suspect, Server.Transfer fixes all of these problems. It does this by performing the transfer on the server without requiring a roundtrip to the client. Examples: Server.Transfer Server.Transfer("Webform2.aspx") Response.Redirect Response.redirect("Webform2.aspx")
__________________ Krishnakumar.S Beware of Everything -that is un true; stick to the Truth shall succeed slowly but steadily |
| |||
| Difference between Server.Transfer and Response.Redirect Server.Transfer() : client is shown as it is on the requesting page only, but the all the content is of the requested page. Data can be persist accros the pages using Context.Item collection, which is one of the best way to transfer data from one page to another keeping the page state alive. Response.Dedirect() :client know the physical loation (page name and query string as well). Context.Items loses the persisitance when nevigate to destination page. In earlier versions of IIS, if we wanted to send a user to a new Web page, the only option we had was Response.Redirect. While this method does accomplish our goal, it has several important drawbacks. The biggest problem is that this method causes each page to be treated as a separate transaction. Besides making it difficult to maintain your transactional integrity, Response.Redirect introduces some additional headaches. First, it prevents good encapsulation of code. Second, you lose access to all of the properties in the Request object. Sure, there are workarounds, but they’re difficult. Finally, Response.Redirect necessitates a round trip to the client, which, on high-volume sites, causes scalability problems. As you might suspect, Server.Transfer fixes all of these problems. It does this by performing the transfer on the server without requiring a roundtrip to the client.
__________________ H2O Without us, no one can survive.. |
| |||
| ResponsetoRedirect: Response.Redirect can be used to redirect to external web sites. Server.Transfer: Server.Transfer can be used only to transfer to other pages of the same web site. Server.transfer transfer the page processing from one page to another page without making a round trip back to the client where as response.redirect redirect to another URL and it make a round trip back to the client. Server.transfer can not transfer page processing from one page to another if the transferred page is in separate application. |
| |||
| Hi, Can we transfer the values also from one page to another page using server.transfer.... I need to take value from one page and transfer to anotherpage.. Can anyone help me?...
__________________ Krishnakumar.S Beware of Everything -that is un true; stick to the Truth shall succeed slowly but steadily |
![]() |
| Thread Tools | |
| Display Modes | |
| |
LinkBacks (?)
LinkBack to this Thread: http://www.discussweb.com/asp-asp-net-programming/3568-difference-between-server-transfer-response-redirect.html | |||
| Posted By | For | Type | Date |
| DiscussWeb IT Community - Technical Support and Technology Discussions | This thread | Refback | 08-30-2007 10:36 PM |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| The server rejected one or more recipient addresses. The server response was: 550 5.7 | poornima | ASP and ASP.NET Programming | 7 | 02-29-2008 01:07 AM |
| What is the difference between Server.Transfer and Response.Redirect?.. | H2o | ASP and ASP.NET Programming | 4 | 11-22-2007 05:25 AM |
| example of Server.Transfer and Context Handler | hanusoft | ASP and ASP.NET Programming | 1 | 09-06-2007 07:08 AM |
| If I use Response.Redirect in try block exception occurred in c#, Why? | kingmaker | C# Programming | 1 | 07-19-2007 04:51 AM |
| What is the difference between Server.Transfer and Response.Redirect? Why would I cho | prasath | ASP and ASP.NET Programming | 1 | 07-19-2007 02:41 AM |