Response.Redirect的VS Server.Transfer的 - 重定向为"建议" [英] Response.Redirect vs Server.Transfer - redirect as a "suggestion"

查看:160
本文介绍了Response.Redirect的VS Server.Transfer的 - 重定向为"建议"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我在Response.Redirect的阅读文章是说的它像一个建议相比,Server.Transfer的这发生在客户端是否愿意与否。这是什么意思?是否有某种类型的事件,我们可以提供一个用户说好没了纳米我不想重定向到该页面?

So I read an article on Response.Redirect that say's "its like a suggestion" as compared to Server.Transfer which happens whether the client wants to or not. What does this mean? Is there some kind of event that we can offer a user to say "well nope nm I don't want to redirect to that page"?

推荐答案

Server.Transfer的将立即执行新的一页,它的结果发送到客户端。结果
客户端停留在原来的网址没有看到什么异常。

Server.Transfer will execute the new page immediately and send its result to the client.
The client stays at the original URL doesn't see anything unusual.

的Response.Redirect 发送一个特殊的code,称为 HTTP 302 ,告诉客户端发送一个新的请求到不同的URL。

Response.Redirect sends a special code, called an HTTP 302, that tells the client to send a new request to a different URL.

这篇关于Response.Redirect的VS Server.Transfer的 - 重定向为"建议"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆