Skip to content

Notifies user prior to session timeout (with countdown timer) and gives option to extend session. Uses jQueryUI Dialog by default but also includes examples using SimpleModal, ThickBox, ColorBox, and a single Div. *Also tested using Telerik's RadNotification.

Notifications You must be signed in to change notification settings

jorgemuza/ASP.NET-Session-Timeout-Control

 
 

Repository files navigation

The ASP.NET Session Timeout Control provides the following:

* User notification that their session is about to expire (includes countdown timer)
* AJAX-enabled session update (enabling users to extend their session without leaving the page)
* Redirect to the designated timeout page upon session expiration.

The Control itself is a .NET 4.0 server control with embedded javascript that provides these capabilities via a 
mixture of client and serverside properties and methods.  The control requires jQuery for interaction with the DOM, 
but can work with any desired notification mechanism such as a simple element or a modal dialog.

By default the control works with the jQuery UI Dialog and whatever jQuery UI theme you have installed - and can be 
implemented with absolutely no coding.  User notification defaults to your site's Session Timeout minus one minute.
Note that Session Timeout is set using the standard .NET sessionState tag in the web.config.

The control is template based and you can layout your desired notification interface within the template or it 
may exist elsewhere on the page.

Properties:

TimeoutMinutes        - Minutes until the user's session will timeout.  Defaults to site's Session Timeout value.

AboutToTimeoutMinutes - Minutes until the user is notified that their session is about to timeout.  Defaults to
                        the TimeoutMinutes minus one.

TimeoutUrl            - The page to redirect to upon timeout.

CountDownSpanId       - The span element to show the countdown timer in.



For using with other notification mechanisms there are 5 key public clientside methods available on the control:

setup()       - used for any one-time setup/configuration that may be needed by your notification mechanism

show()        - show the notification to the user

hide()        - hide the notification from the user

reset()       - called by the user to extend their session (also hides the notification, resets timers, etc)

timeout()     - occurs upon session timeout.  Redirects by default.

Examples in the included project demonstrate using the control with:
jQuery UI Dialog
SimpleModal
ThickBox
ColorBox
Div (also demonstrates resetting control from content page)
(more coming soon)

About

Notifies user prior to session timeout (with countdown timer) and gives option to extend session. Uses jQueryUI Dialog by default but also includes examples using SimpleModal, ThickBox, ColorBox, and a single Div. *Also tested using Telerik's RadNotification.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published