Login or Sign Up to become a member!
LessThanDot Sit Logo

LessThanDot

Community Wiki

Less Than Dot is a community of passionate IT professionals and enthusiasts dedicated to sharing technical knowledge, experience, and assistance. Inside you will find reference materials, interesting technical discussions, and expert tips and commentary. Once you register for an account you will have immediate access to the forums and all past articles and commentaries.

LTD Social Sitings

Lessthandot twitter Lessthandot Linkedin Lessthandot friendfeed Lessthandot facebook Lessthandot rss

Note: Watch for social icons on posts by your favorite authors to follow their postings on these and other social sites.

Navigation

Google Ads

ASP.NET: Redirect the page when the session ends

From Wiki

Jump to: navigation, search

Summary: A simple way of redirecting the user to a certain page when their session ends.

Here's a simple method, without using javascript, to redirect the user to a certain page once their session ends:

  1. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  2.     If Not Page.IsPostBack Then
  3.         Response.AppendHeader("Refresh", (Session.Timeout * 60) + 5 & "; Url=SessionEnded.aspx")
  4.     End If
  5. End Sub


This Hack is part of the ASP.NET Hacks collection

465 Rating: 3.3/5 (11 votes cast)