Problem: I am looking to create a time-out warning message on an asp.net page with a c# code behind based off my webconfig sessionState TimeOut Attribute.
Code on w
I was not able to get FishbasketGordo's code to work because the Web Method call kept passing the Boolean value "false" as the onsuccess method. After much research I made the following changes.
$(function () {
var isTimeout = false;
var callback = function (isTimeout) {
if (isTimeout) {
// Show your pop-up here...
alert("You have timed out");
}
};
var failure = function () {
alert("Problem with Server");
};
setInterval(
function () {
// Don't forget to set EnablePageMethods="true" on your ScriptManager.
PageMethods.HasSessionTimedOut(callback,failure);
}, 30000
);
});