
Originally Posted by
kunalraj
hi,
try like this,
1. In the Page_Load function (can be Master page too) I wrote next code :
Response.AppendHeader("Refresh", Convert.ToString(Session.Timeout * 1) & ";
URL=Timeout.aspx")//Timeout.aspx page you have to create and write below code
2. In the Timeout.aspx after before </head > I wrote next code:
<script type="text/javascript" language="javascript">
function endSession()
{
alert("Your session has expired. You will be redirected to the login page.");
url = '<%=mstrLoginURL %>';
document.location=url;
}
registerLoadTask('endSession()')
</script>
3) In the Timeout.aspx in the Page_Load function I wrote next script:
If Not IsPostBack Then
mstrLoginURL = ResolveUrl("LogIn.aspx")
End If
Hope it will help you.
thanks,
kunalraj
Bookmarks