Geeks With Blogs
Carmel's Blog Independent Software Professional
Script Manager Object allows developers to add AJAX Capabilities to ASP.NET page, this object contains end request event in the client side, this event fired when the AJAX request completed. AJAX request may complete successfully, with errors or timeout.

End Request event have args object, the args object can be used to examine the request completion. The args object contains the following members:

args._errorHandled - Boolean property indicates whether you handled the error or not.

args._response - Response property object.

args._dataItems - Array of items sent from server to the client.

args._error - Error object holds the error returned.

You can use these members to get information about the completion of the request: one use of these arguments is to identify error details in case of error any error returned from the server, for instance timeout error occurs when no response from server after timeout elapsed (default value - 90 seconds), this error raised and showed as a message box to the user, to change this behavior all we need is to write proper of the desired behavior and suppress the error, the following Code describes how to perform this task:

<script language="javascript" type="text/javascript">

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

 

function EndRequestHandler(sender, args) {

if (args._response._timedOut == true) {

           
alert('My Own Implementation');

           

args._errorHandled = true;   

}

               

}

</script>

Posted on Tuesday, November 11, 2008 6:17 AM | Back to top


Comments on this post: End Request Agrs Object

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Carmel Halabe | Powered by: GeeksWithBlogs.net