System.Web.HttpContext.Current.Response.Redirect("login.aspx")--》 ((Page)System.Web.HttpContext.Current.Handler).RegisterStartupScript("js","<script language=javascript>window.location.href='login.aspx';</script>"); 

解决方案 »

  1.   

    在 Session_End里执行转向是非常奇怪的,因为这事件是有可能在用户没有请求下执
    行的,你的意思是指Session_Start吧
      

  2.   

    我就是想在session失效的情况下执行页面的跳转,session_end 不能实现吗
      

  3.   


    能不能这样写
    Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
    Response.Write("<script language=javascript>windwow.open('login.aspx');</script>")
    end sub
      

  4.   

    或者这样
    Sub  Session_End(ByVal  sender  As  Object,  ByVal  e  As  EventArgs)  
    Response.Write("<script  language=javascript  >windwow.open('login.aspx',_top');  </script>")  
    end  sub
      

  5.   

    1. use Session_Start2. useSystem.Web.HttpContext.Current.Response.Write("<script language=javascript>top.location.href='login.aspx';</script>"); or in login.aspx<script language="javascript">
    if (window != top)
      top.location.href = window.location.href
    </script>