ASP.NET Push Redirect on Session Timeout

前端 未结 10 1880
Happy的楠姐
Happy的楠姐 2020-11-29 21:04

I\'m looking for a tutorial, blog entry, or some help on the technique behind websites that automatically push users (ie without a postback) when the session expires. Any h

10条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-29 21:57

    Just copy and paste this code snippet in your Web.Config file :

    
      
    
    
    
    

    You can put this line to your Site.Master :

    Response.AppendHeader("Refresh", 
                          Convert.ToString((Session.Timeout * 60)) + 
                          ";URL=~/Login.aspx");
    

提交回复
热议问题