Skip to content Skip to sidebar Skip to footer

Pageload Event Fires Multiple Times Due To Idletimeout Plugin?

We are having some strange issues on an asp.net web form project where the page loads and displays some data (basically a gridview). We noticed something strange when setting a br

Solution 1:

The plug-in needs a keepAliveURL: parameter to know what service or handler to call to sustain the session.

If you check the GitHub Repo

$.ajax({
        timeout: options.AJAXTimeout,
        url: options.keepAliveURL,
        error: function(){
        self.failedRequests--;
     },
     success: function(response){
        if($.trim(response) !== options.serverResponseEquals){
             self.failedRequests--;
        }
     },
     complete: function(){
         if( recurse ){
             self._startTimer();
         }
     }
 });

You notice the App depends on the ajax call needs


To Fix: add keepAliveURL: listener

$.idleTimeout('#dialog', 'div.ui-dialog-buttonpane button:first', {
    idleAfter: sessionTimeoutWarning,
    keepAliveURL: 'keepalive.asmx',
    serverResponseEquals: 'OK',
    onTimeout: function () {

The listener (any web method will do) should respond with Content("OK") as you have instructed:

serverResponseEquals:'OK',

[WebMethod]
publicvoidkeepalive()
{
    HttpContext.Current.Response.Write("OK"); 
    HttpContext.Current.Response.End();
}

Post a Comment for "Pageload Event Fires Multiple Times Due To Idletimeout Plugin?"