捕获 ASP.NET 的 Response.Redirect

发布于 2024-12-08 17:02:29 字数 222 浏览 0 评论 0原文

我试图通过 javascript/jquery 从客户端捕获 asp.net 的重定向响应,但我无法管理它。

我的目标是捕获重定向网址并修改它。有什么办法可以做到吗?

更多详细信息: 我正在将应用程序转换为 ajax 样式。我通过 jquery.load 方法加载页面,因此当我发布表单时,它会从容器中加载。我知道这不是一个好办法,但对我来说这是暂时最好的办法。

I am trying to catch redirect response of asp.net from client-side by javascript/jquery but I could not manage it.

My target is catching redirect url and modifying it. Are there any way to do it?

More Details:
I'm converting an application to ajax style. I'm loading pages by jquery.load method so when I post a form it is loading out of the container. I know it is not a good way, but it is temprorarily best way for me.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

她比我温柔 2024-12-15 17:02:29

无法使用 JavaScript 捕获重定向信息。当浏览器收到 HTTP 301 或 HTTP 302 标头时,客户端代码甚至不会加载,它会自动向新 URL 发送 GET 请求。

There's no way of catching redirect info with JavaScript. Clientside code is not even loaded when browser receives HTTP 301 or HTTP 302 headers, it automaticaly sends GET request to new URL.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文