Here's three simple ways to handle DevExpress ASP.NET Callback Errors:
- Do nothing.
- ....
- PROFIT!
Do Nothing?
Yes. For the last couple of years, DevExpress ASP.NET products have been using the excellent ASPxHttpHandlerModule to:
- Catch callback errors within DevExpress ASP.NET controls
- Bubble them up and display them to you
Callback Errors in 2014
I'm writing this blog post because of a video that I made on how to handle Ajax Callback Errors. That was six years ago in 2008! In fact, you can still read it here: Ajax Callback Error in ASP.NET – Video on How-To Handle
It surprises me that developers are still requesting this video. While's the video is still available, it's not needed anymore. Here's why:
Web.Config
When you use DevExpress ASP.NET, you'll notice that your web.config file is updated. That's because the versatile DevExpress ASPxHttpHandlerModule not only handles errors but it's also used for many other things like compressing and combining scripts, delivering images, etc.
DevExpress Help: Web.Config Options Overview
So, what's a callback error?
First, let me define a callback:
On the other hand, a callback is also a special kind of postback, but it is just a quick round-trip to the server to get a small set of data (normally), and thus the page is not refreshed, unlike with the postback...think of it as 'calling the server, and receiving some data back' - Excellent stackoverflow answer from Andreas Grech
Therefore, a callback performs a partial page update. So when you page, sort, or do some other operation on the DevExpress ASP.NET GridView, a callback occurs on the server and only the grid is redrawn.
A callback error occurs when there's an error on the server side during the callback. And because the page is only refreshing a portion of itself, you may not always see the error. And this is where the ASPxHttpHandlerModule will catch the error for you and display it as well.
The more you know...
Now that you're empowered with this peace of mind, treat yourself to a chocolate cupcake.
When only the best will do.
From interactive Desktop applications, to immersive Web and Mobile solutions, development tools built to meet your needs today and ensure your continued success tomorrow.
Get full access to a complete suite of professional components that let you instantly drop in new features, designer styles and fast performance for your applications.
Download a free and fully-functional version now: http://www.devexpress.com/Downloads/NET/