According to this page there is no way how to easily catch all exceptions which occur during callback processing (note that Page_Error and even global.asax Application_Error methods are not fired during callback processing). Of course, you can surround all of your codebehind callback methods with try ... catch blocks, but this is not elegent way how to catch all exceptions. We need one piece of code, where we can catch and process all unhandled exceptions.
The only solution I have found so far, is to create your own class which will derive from devexpress control, which you use to process callbacks (in our case ASPxCallbackPanel):

public class ASPxCallbackPanelExtended : ASPxCallbackPanel
{
    protected override string OnCallbackException(Exception e)
    {
        Logger.Log(e);

        return base.OnCallbackException(e);
    }
}

Than you will need to replace all existing ASPxCallbackPanelfrom your pages with ASPxCallbackPanelExtended:

<dev:ASPxCallbackPanelExtended ID="panPersonalData" ClientInstanceName="panPersonalData"
    runat="server" OnCallback="panelPersonalData_OnCallback" HideContentOnCallback="False"
    EnableCallbackCompression="true">
...
</dev:ASPxCallbackPanelExtended>

Yes, this solution is not perfect too, because you need to derive from all classes which can cause callbacks and override OnCallbackException method in your application (for example ASPxCallback), but this is the only solution I have found.

2 comments

# Waters Loans on 02/02/10 at 15:32
I admire what you have done here. I like the part where you say you are doing this to give back but I would assume by all the comments that this is working for you as well.
# Fine Food on 03/10/10 at 19:06
thanks for that

This post has 18 feedbacks awaiting moderation...

Leave a comment


Your email address will not be revealed on this site.

Your URL will be displayed.
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)

Contact Us


Are you interested in professional services of the developers who publish on this blog? Contact us on our web site now.

XML Feeds

Add to Technorati Favorites
September 2010
Mon Tue Wed Thu Fri Sat Sun
 << <   > >>
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30