Current filter:
                                You should refresh the page.

                                How to control state when the Session is being expired and prolong it on demand

                                0

                                This example illustrates how to create a timeout control for web sites (similar to what banks and other financial institutions have) that will display a modal popup dialog displaying the time remaining before a session is timed out and redirected to a page explaining what happened:
                                ASP.NET WebForms Blog Post
                                ASP.NET MVC Blog Post

                                This example contains two solutions:
                                The solution for v2010 vol 2.8+ versions - is an ASP.NET WebSite project.
                                The solution for v2011 vol 1.12+ versions - is an ASP.NET WebApplication project.

                                You must  log in  or  register  to leave comments
                                Select file
                                • Default.aspx
                                • Default.aspx.cs
                                • TimeoutControl.ascx
                                • TimeoutControl.ascx.cs
                                • TimeOutPage.aspx
                                Select language
                                • C#
                                • VB.NET
                                Select version
                                • v2011 vol 2.12 - v2012 vol 2.8
                                • v2010 vol 2.8 - v2012 vol 2.4
                                <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApp._Default" %>
                                <%@ Register Src="TimeoutControl.ascx" TagName="TimeoutControl" TagPrefix="uc1" %>
                                <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                                <html xmlns="http://www.w3.org/1999/xhtml">
                                <head runat="server">
                                    <title></title>
                                </head>
                                <body>
                                    <form id="form1" runat="server">
                                        <p>
                                            A timeout warning popup will be shown every <%= Session.Timeout - 1 %> min.
                                        </p>  
                                    <uc1:TimeoutControl ID="TimeoutControl1" runat="server" />
                                    </form>
                                </body>
                                </html>