A
ad
I want to redirect to a TimeOut page when a user didn't access web site for
a while.
I write a BasePage class, and all web page in my project inherent the
BasePage like below.
But I foundwhen user did not access web site for a while, and then access
web page again, it was redirrect the the
LoginUrl which is set in web.config.
Why, I think it will redirect to TimeOut.html
//---- the LoginUrl in web.config
<authentication mode="Forms">
<forms name="HealthCookie" loginUrl="Home.aspx">
//--------- the BasePage
public class BasePage :System.Web.UI.Page
{
public BasePage()
{ }
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
if (Context.Session!=null)
if (Session.IsNewSession)
{
Response.Redirect("TimeOut.html");
}
}
}
a while.
I write a BasePage class, and all web page in my project inherent the
BasePage like below.
But I foundwhen user did not access web site for a while, and then access
web page again, it was redirrect the the
LoginUrl which is set in web.config.
Why, I think it will redirect to TimeOut.html
//---- the LoginUrl in web.config
<authentication mode="Forms">
<forms name="HealthCookie" loginUrl="Home.aspx">
//--------- the BasePage
public class BasePage :System.Web.UI.Page
{
public BasePage()
{ }
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
if (Context.Session!=null)
if (Session.IsNewSession)
{
Response.Redirect("TimeOut.html");
}
}
}