关于 context.Response.Redirect 跳转问题 .
2014-11-20 09:09
211 查看
查看这篇帖子Response.Redirect 发现的问题
1:采用ajax方式提交给IHttpHander
因为你是使用的异步请求的方式,页面自然不会跳转(帖子已经说明),这个时候context 对象应该被挂起了吧
要想跳转 可采用
a:IHttpHander 的返回值在跳转
b:
[csharp]
view plaincopyprint?
context.Response.Write(string.Format("window.location.href='{0}';", “你跳转的路径"));
如果web.config 中添加
[html]
view plaincopyprint?
<add verb="*" path="*.ashx" type=" System.Web.IHttpHandler"/>
b方式也无法跳转(已经测试过,不知道原因,可能更IHttpHander 请求关联...)
2:当然就是非ajax方式请求 IHttpHander 中的
[csharp]
view plaincopyprint?
context.Response.Redirect
是ok的 千万不要采用上面的b方式 因为那是直接输出 到当前页面
[javascript]
view plaincopyprint?
window.location.href=‘你跳转的路径’
1:采用ajax方式提交给IHttpHander
因为你是使用的异步请求的方式,页面自然不会跳转(帖子已经说明),这个时候context 对象应该被挂起了吧
要想跳转 可采用
a:IHttpHander 的返回值在跳转
b:
[csharp]
view plaincopyprint?
context.Response.Write(string.Format("window.location.href='{0}';", “你跳转的路径"));
context.Response.Write(string.Format("window.location.href='{0}';", “你跳转的路径"));
如果web.config 中添加
[html]
view plaincopyprint?
<add verb="*" path="*.ashx" type=" System.Web.IHttpHandler"/>
<add verb="*" path="*.ashx" type=" System.Web.IHttpHandler"/>
b方式也无法跳转(已经测试过,不知道原因,可能更IHttpHander 请求关联...)
2:当然就是非ajax方式请求 IHttpHander 中的
[csharp]
view plaincopyprint?
context.Response.Redirect
context.Response.Redirect
是ok的 千万不要采用上面的b方式 因为那是直接输出 到当前页面
[javascript]
view plaincopyprint?
window.location.href=‘你跳转的路径’
相关文章推荐
- 关于 context.Response.Redirect 跳转问题
- 关于Response.Redirect 端口不一致的跳转
- mvc 使用response.redirect跳转地址问题
- 关于Response.Redirect 端口不一致的跳转
- mvc中用response.redirect跳转后,后续代码还会执行的问题
- 关于Response.Redirect的问题
- asp.net 关于Response.Redirect重定向前无法弹出alert对话框的问题
- 关于ASP.NET MVC中Response.Redirect和RedirectToAction的BUG (跳转后继续执行后面代码而不结束进程)以及处理方法
- 苍天啊大地啊,谁能解决这个问题啊(asp.net开发WAP,关于SelectionList和response.redirect)
- aspx在页面跳转(Response.Redirect)时丢失session问题及解决办法
- Response.Redirect 关于页面跳转
- 使用Response.Redirect跳转时显示提示内容的问题该怎么解决
- jsp的response.sendRedirect()与request.getRequestDispatcher()关于路径跳转的问题
- 关于httpcontext实际使用时出现的一个问题
- 关于ASP.NET中用Response.Write()方法响应导致页面字体变大的问题
- 关于锚点页内链接跳转出现问题(不响应,没有反应)的解决方法(ZT)
- 关于在页面跳转前alert()不能弹出消息的问题
- Server.Transfer是服务器端跳转 Response.Redirect是客户端跳转
- 关于在SPRING中的页面跳转和重定向(Forward&Redirect)
- response.redirect和pageContext.forward的区别