I am currently working on an web application that uses ASP.NET 2.0 framework. I need to redirect to a certain page, say SessionExpired.aspx, when the user session expires. T
If I understand correctly, "Session_End" fires internally and does not have an HTTP context associated with it:
http://forums.asp.net/t/1271309.aspx
Therefore I don't think you could use it to redirect the user. I've seen others suggest using the "Session_OnStart()" event in the global.ascx file:
http://forums.asp.net/p/1083259/1606991.aspx
I have not tried it, but putting the following code in "global.ascx" might work for you:
void Session_OnStart() {
if (Session.IsNewSession == false )
{
}
else
{
Server.Transfer("SessionExpired.aspx", False);
}
}