Hello everyone!!!!!!!
I am using the following timescript code in master pages for 2 projects in same solution. I need to embed this JS in a common library.
My question is: This timeout script redirects to "Timeout.aspx" page after 15 mins of inactivity. Now this path location is different for both the projects. So if I embed this in a common project folder and give a reference to this JS from the reqd 2 project folders. Then how can I change the redirect path location?
Would appreciate if somebody can help me with the code.
// JScript File
function ParentTimeOut()
{
var timeout = 60000 * 1; // 15 minutes
var pageStarted = new Date(); // initial time
var timeOutVal = Converter.ToString(timeout));
var sinceLastCheck = new Date() ;
var ele document.getElementById('ValidationSummary1.ClientID');
if (Request.IsAuthenticated)
{ // if user is logged in, then set timeout script
timeout ();
function timeout ()
{
if (window.document.location.href.indexOf('timeout') == -1)
{
if ((sinceLastCheck - pageStarted) > timeOutVal)
{
document.location.href= 'Timeout.aspx';
}
}
sinceLastCheck = new Date();
var t=setTimeout('timeout()',10000);
}
}
// the progress display script here
var imageInfo=['/images/loader.gif', 16, 16]; // image src, width, height");
stopAni();
}
function startAni(sender, args, offset)
{///////////************some code in here**********//////////////}
function stopAni()
{///////////************some code in here**********//////////////}