﻿///// AJAX functionality

Sys.Application.add_load(ApplicationLoad);

function ApplicationLoad()
{
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequest);
    Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(BeginRequest);
}
 
function BeginRequest(sender, args) 
{
    // window.alert('captured begin');
}
 
function EndRequest(sender, args)
{
    // window.alert('captured end');
    
    // Check to see if there's an error on this request.
    if (args.get_error() != undefined)
    {
        // If there is, show the custom error.
        // $get('Error').style.visibility = "visible";

        // window.alert(args.get_error().message);

        // Let the framework know that the error is handled, 
        //  so it doesn't throw the JavaScript alert.
        args.set_errorHandled(true);
    }
}

