Wednesday, March 26, 2008

Catch the end request of UpdatePanel

1. Get instance of PageRequestManager

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(endRequestHandler);

2. Callback function:

function endRequestHandler(sender, eventArgs)
{
    if (eventArgs.get_error() != undefined && eventArgs.get_error().httpStatusCode == '500')
    {
        var error Message = eventArgs.get_error().message;
        eventArgs.set_errorHandler(true);
        alert(errorMessage);
    } else
    {
        //alert($get("hidField").value);
    }
}

No comments:

Post a Comment