Category: DevExpress

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.

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
February 2012
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