BusinessRx Community

Dedicated to the advancement of software, technology and the people who devote their lives to it.

Welcome to BusinessRx Community Sign in | Join | Help
in Search

BusinessRx Reading List

These blog entries are written by industry experts and leaders. We consider this content to be a good read for any software developer or web technologist.

Tip/Trick: Handling Errors with the UpdatePanel control using ASP.NET AJAX

Luis Abreu is an ASP.NET MVP who has a great blog on the http://msmvps.com blog site.  Earlier today he posted a great tutorial post that describes how to use some of the new features in the ASP.NET AJAX Beta1 release to add more robust error handling into your application.  I highly recommend reading and bookmarking it for future use.

Error handling in an AJAX world can often be tricky -- especially when AJAX call-backs are taking place and a mixture of client and server code is running within an application.  In its most recent release, the <asp:updatepanel> control that comes with ASP.NET AJAX now has much more robust error handling and reporting features for you to use.  Specifically:

1) You can now handle the "OnAsyncPostBackError" event on the <asp:scriptmanager> control to catch and/or modify an error message that occurs during the processing of an AJAX postback callback on the server. 

2) You can now set the "AllowCustomErrors" property on the <asp:scriptmanager> control to enable the standard ASP.NET custom error support to be enabled to redirect a user automatically to an error page when an error occurs (even if it is happening during an AJAX postback).

3) You can now optionally handle client-side JavaScript events on the page to intercept any error message sent back from the server, and perform custom client-side actions as a result (for example: to output the error message to a nicely formatted <div> section instead of performing a pop-up message). 

Read all about how to take advantage of the above new features from Luis' great tutorial here.

Hope this helps,

Scott

Share this post: Email it! | bookmark it! | digg it! | reddit!
Published Sunday, October 29, 2006 6:56 PM by ScottGu's Blog

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

Leave a Comment

(required) 
(optional)
(required) 
Submit
Powered by Community Server, by Telligent Systems
'