捕获 ASP.NET 的 Response.Redirect
我试图通过 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技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
无法使用 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.