C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




How to Redirect the page when the session ends


Posted Date: 03 Apr 2008    Resource Type: Code Snippets    Category: ASP.NET WebForms

Posted By: Giribabu       Member Level: Gold
Rating:     Points: 10



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.

C#

protected void Page_Load(object sender, System.EventArgs e) {
if (!Page.IsPostBack) {
Response.AppendHeader("Refresh", (((Session.Timeout * 60)
+ 5)
+ "; Url=SessionEnded.aspx"));
}
}




Responses

Author: Mark Smith    10 Apr 2008Member Level: Bronze   Points : 0
http://aspnetlibrary.com/codebankdetails.aspx?Type=&codebank=Redirect-the-page-when-the-session-ends


Author: mahua dutta    28 Apr 2008Member Level: Silver   Points : 2
nice..its working....


Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Redirect  .  Handle session expiration  .  ASP.NET  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: How to access master page controls & writing button click event
Previous Resource: Adding and Retrieving Session variables with HttpContext
Return to Discussion Resource Index
Post New Resource
Category: ASP.NET WebForms


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

doors in nj

Contact Us    Privacy Policy    Terms Of Use