This is a migrated thread and some comments may be shown as answers.

Client side Ajax Exception Handling

1 Answer 88 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Alexandre BARBIER
Top achievements
Rank 1
Alexandre BARBIER asked on 13 Dec 2010, 05:07 PM
Hi

I'm trying to find a simple way to handle all potential unhandled exception raised by the server code, but handle them on the client side.

To handle to the server side, I'm just using OnAsyncPostBackError off the scriptmanager.

To handle to the client side, I did something like that:

 

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

 

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

 

function EndRequestHandler(sender, args) {

 

 

if (args.get_error()) {

 

 

var msg = args.get_error().description;

 

alert(msg);

args.set_errorHandled(

true);

 

}

}

 

</script>

Is there a simplier way, like some client event on the RadAjaxManager ?

p.s. : I'm using RadControls for ASP.Net Ajax v 2010.1.519.35

 

1 Answer, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 14 Dec 2010, 10:39 AM
Hello Alexandre,

This is the way that server errors can be intercepted on client after async postback. RadAjax does not expose API for handling this exceptions.

Kind regards,
Nikolay
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Ajax
Asked by
Alexandre BARBIER
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Share this question
or