I have seen this error occur when a button is clicked from within an UpdatePanel and the session has timed out. You can trap this error by adding a javascript error handler.
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
function EndRequestHandler(sender, args) {
if (args.get_error() != undefined) {
var errorMessage;
var error = args.get_error;
if (args.get_response().get_statusCode() == '12031') {
errorMessage = "Session Timeout.";
}
else if (args.get_response().get_statusCode() == '200') {
errorMessage = args.get_error().message;
}
else {
errorMessage = 'An unspecified error occurred. ';
}
args.set_errorHandled(true);
alert("An error occurred: " + errorMessage + " Please refresh the page to restart your session.");
}
}
Hope it helps!!
Thanks