我在Session_End里面加了一条语句: Response.Redirect("default.aspx")
可是在Session超时的时候没有反应,请教是怎么回事?还有其它方法吗??谢谢!!!
Session_End是指程序中把Session.Abandon()时才执行的
Session超时你可以在每个网页上加一句javascript脚本
<script>
setTimeout(1000 * 超时的秒数, "document.location.href=default.aspx;");
</script>
可以作一个HttpModule注册在项目中, 让请求的每个页面都有这一句
Session_End can run any time after the expiration and even without a user request, you probably want to add
Response.Redirect("default.aspx")
to Session_Start (of course, check if the request is for "default.aspx", if it is, dont call Redirect)