How to Automatically Redirects to LoginPage when Session Timeout
Hi friends,We already know sessions plays a very important role in the WebApplications.In this i would like to explain how to Redirect the page when sessions timeout.
just write the following code in the page from which page you would like to redirect
You can directly redirects to Loginpage or sessionPage...
That's it..If You Have any doubts please feel free to ask me i will always ready to help you
just write the following code in the page from which page you would like to redirect
protected void Page_Load(object sender, EventArgs e)
{
string ToRedirectURL = "sessionpage.aspx";
Response.AppendHeader("REFRESH", "20;URL=" + ToRedirectURL);
}
After the 20 seconds the page will be redirects to session page as shown below in the figureYou can directly redirects to Loginpage or sessionPage...
That's it..If You Have any doubts please feel free to ask me i will always ready to help you
Labels: .Net Tutorials, Aspnet, C#, CSharp, Sessions, Tanisha
4 Comments:
super...its working fine
rock..........
Thanks for sharing taanu.......
thanks
Post a Comment
Subscribe to Post Comments [Atom]
<< Home