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.
As a part of a client portal project we had a requirement to load documents displayed in the portal from a SharePoint document library. This seems like quite an interesting idea, because you don't need to build any fancy Content Management System (CMS) into your site for people to upload content and documents; they will just use standard SharePoint user interface to save documents into document library and your portal will take the content from there.
That's why I decided to create a generic component which will take documents from a document library on SharePoint and publish them as a part of any website.
The component loads data from a SharePoint Document Library:
And displays them inside a standard ASP.NET web application:
This article describes how you can build such solution.