The following are thedifferences between Server.Transfer and Response.Redirect
1. Just like hyperlink and Response.Redirect,Server.Transfer is used to navigate to other pages/sites running on the sameweb server.
2. Server.Transfer cannot be used to navigate tosites/pages on a different web server.
3. Server.Transfer does not change the URL in the addressbar
4. Server.Transfer is faster than Response.Redirect asthe redirection happens on the server in one Request/Response cycle.Response.Redirect() involves 2 Request/Responsecycles.
1. Just like hyperlink and Response.Redirect,Server.Transfer is used to navigate to other pages/sites running on the sameweb server.
2. Server.Transfer cannot be used to navigate tosites/pages on a different web server.
3. Server.Transfer does not change the URL in the addressbar
4. Server.Transfer is faster than Response.Redirect asthe redirection happens on the server in one Request/Response cycle.Response.Redirect() involves 2 Request/Responsecycles.
5. With Server.Transfer the Form Variables from theoriginal request are preserved.
本文详细对比了Server.Transfer和Response.Redirect两种网页导航方法的区别。Server.Transfer无法跨服务器导航,但能保留原始请求中的表单变量,且不会改变地址栏中的URL。相比之下,Response.Redirect涉及两次请求/响应周期,适合跨服务器导航。

被折叠的 条评论
为什么被折叠?



