﻿function KeepAlive() {
    var wRequest = new Sys.Net.WebRequest();
    wRequest.set_url("KeepAlive.aspx");
    wRequest.set_httpVerb("POST");
    wRequest.add_completed(sessionKeepAlive_Callback);
    wRequest.set_body("");
    wRequest.get_headers()["Content-Length"] = 0;
    wRequest.invoke();
}

// This callback function processes the
// request return values. It is called asynchronously
// by the current executor.
function sessionKeepAlive_Callback(executor, eventArgs) {
    // No need to do anything, but if you are sending a value
    // from the server as an additional safety measure, then
    // you can check that here.
}

// Set 12 minute .NET session keep alive timer...
window.setInterval("KeepAlive()", 15*60*1000);
