Actually what i want to convey is
when the session is time out asp.net application goes to session_end event
(the code is shown below)after rumnning the event it stays in the same page
.I want to transfer to sessionTimeOut.aspx page .But beacause Session_End
fires outside of a Request into your system I can't use Response.Redirect.
How do I redirect now?
Regards
protected void Session_End(Object sender, EventArgs e)
{
if (Session["SessionID"] != null)
{
try
{
string LogoutURL="../Public/SessionTimeOut.aspx";
ESMSecurityModule.killSession(Session["SessionID"].ToString());
Session.Clear();
Session.Abandon();
Response.Redirect(LogoutURL);
}
catch
{
}
}
}
How to timing out the asp.net web application when not in use for 15
Brock Allen said:
Session_End fires outside of a Request into your system. So since there's
no request, there's no where to transfer to. When you should do is check
upon the next request to see if your Session data is gone, and if so take
the appropriate actions.
Now, since you've mentioned a login page, why are you using Session state
to track to see if the user's logged in? You should be using Forms
authentication, as this does all the necessary work to redirect the user
to a login page if they're not currently logged in.