﻿


try {
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
}
catch (e) {
}

function EndRequestHandler(sender, args) {
    if (args.get_error() != undefined) {
        var errorMessage = "There was an unexpected error processing the your request.\r\n\r\n";
        errorMessage += "What Happened: There was an unexpected error in this website.\r\n\r\n";
        errorMessage += "How this will affect you: The current page will not load.\r\n\r\n";
        errorMessage += "What you can do about it: Close your browser, navigate back to this website, and try repeating your last action. Try alternative methods of performing the same action. If problems persist, contact the system administrator."
//        if (args.get_response().get_statusCode() == '200') {
//            errorMessage = args.get_error().message;
//            
//        }
//        else {
//            // Error occurred somewhere other than the server page.
//            errorMessage = 'An unspecified error occurred. ';
//        }
        args.set_errorHandled(true);
        alert(errorMessage);
    }
}



// Tells the ScriptManager that the script has been loaded
//   This is required on any external javascript files included as a reference
//   using the script manager object.
if (typeof (Sys) !== "undefined") {
    Sys.Application.notifyScriptLoaded();
}
