C# 无法在发送 HTTP 标头之后进行重定向

在调试中发现错误如下:

     Response.Redirect引起的“无法在发送HTTP标头之后进行重定向” 跳转失败

 

解决方案如下:

 使用js方法来跳转地址

1 const string url="<script>window.location.href='/login/index'</script>;

2 System.Web.HttpContext.Current.Response.Write(url);

3 System.Web.HttpContext.Current.Response.End();

 

posted @ 2017-01-11 20:49  骚年丶勿忘初心。  阅读(3075)  评论(0编辑  收藏  举报