I have a WARP whose trigger control is a button. If an exception occurs in the buttons click handler it gets lost.
I've attached a zip file of the code (VS2008, Infragistics 9.1 CLR3.x). I throw an exception in the buttons click handler. If this is run without debugging (Cntrl+F5) the page appears to run correctly instead of returning the default aspx error page as expected.
If the page is built without WARP the error page is returned as expected.
I suspect there is something I have to add so that the exception will trigger the error page but I haven't been able to find it.
Thanks for any help,
Dave
Victor,
Thanks for the reply.
The client side code works but I don't see any difference when I add the server side code. What is the result of this supposed to be? It may be incorrect but I expected to get the normal unhandled exception error message sent back to my browser when the exception is thrown.
Hi Dave,
Since errors/exceptions within async postback which was triggered by CallBackManager (used for WARP and UltraWebTab) in most cases do not belong to a particular WARP or UltraWebTab, the error handling on server is static. The CallBackManager has public methods Add/RemoveErrorHandler.
Errors also can be processed on client using ClientSideEvents.Error property (javascript for that handler can be generated by WARP automatically at visual design).
Below is example for both those handlers.
aspx:
<script type="text/javascript">function WebAsyncRefreshPanel1_Error(oPanel, oEvent, flags){ alert('flag:' + flags + '\nserverError:' + ig_shared.getCBManager().serverError);}</script><igmisc:WebAsyncRefreshPanel ID="WebAsyncRefreshPanel1" runat="server" ClientError="WebAsyncRefreshPanel1_Error"></igmisc:WebAsyncRefreshPanel>
vb:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Infragistics.WebUI.Shared.CallBackManager.AddErrorHandler(Me, AddressOf Me.OnWarpError)End Sub
Protected Sub OnWarpError(ByVal sender As Object, ByVal e As UnhandledExceptionEventArgs) Dim ex As Object = e.ExceptionObject If (e.IsTerminating = True) Then ex = "Error will trigger full post back on client." End IfEnd Sub