ASP.NET session expired simple solution

 
Add the following code to the template.master.cs file:

         protected   void  Page_PreRender( object  sender, EventArgs e)
        
{
            HttpContext.Current.Response.AppendHeader(
"Refresh",
                Convert.ToString(((HttpContext.Current.Session.Timeout 
* 60- 5))
                
+ "; Url=default.aspx?timeout=true");

        }


obviously, the value Url=default.aspx?timeout=true would be that of an informational page or  a parameter added onto the default.aspx page that when opened diplays the 'information' panel.

你可能感兴趣的:(asp.net)