Friday, October 01, 2010

How to handle asynchronous request errors and reqeust end event in JavaScript

<script language="javascript">
    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
    function EndRequestHandler(sender, args) {
        if (args.get_error() != undefined) {
            if ((args.get_response().get_statusCode() == '12007')
                 || (args.get_response().get_statusCode() == '12029')) {
                alert('Time-out Error');
                args.set_errorHandled(true);
            }
        }
    }
</script>

No comments:

iPhone Launch Screen Sizes

iPhone Portrait iOS 8 Retina HT 5.5 = 1242 X 2208 Retna HD 4.7 = 750 X 1134 iPhone Landscape iOS 8 Retina HD 5.5  2208 X 1242 iPho...