Last post Apr 27, 2009 09:13 PM by SGWellens
Apr 27, 2009 05:14 PM|IceMage|LINK
Code behind helps in making ASP.NET handle more like an application. I'd like to see session events and code-behind to help accomplish this, which would greatly help in making the entire session feel more like an application to the developer, etc. etc.
Event handlers should include at least
Session Load (The session is being created.)
Session Close (The session is being closed forcibly, e.g., user logged off)
Session Unload (The session is unloading for some reason, either expiring, or was closed forcibly)
Session Expires (The session has expired and will no longer be valid)
Session Refresh (User browser activity, e.g., following a link or a post-back.)
We should be able to set up session timers as well, to run code if the user is away for an extended period of time.
Apr 27, 2009 09:13 PM|SGWellens|LINK
Most of those already exist. You need to look at global.asax:
<%@ Application Language="C#" %>
void Application_Start(object sender, EventArgs e)
void Application_BeginRequest(object sender, EventArgs e)
void Application_EndRequest(object sender, EventArgs e)
void Session_Start(object sender, EventArgs e)
void Application_End(object sender, EventArgs e)
void Application_Error(object sender, EventArgs e)
void Session_End(object sender, EventArgs e)
// Code that runs when a session ends.
// Note: The Session_End event is raised only when the sessionstate mode
// is set to InProc in the Web.config file. If session mode is set to StateServer
// or SQLServer, the event is not raised.