Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
275
WebAsyncRefreshPanel swallows exceptions
posted

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

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Default.aspx.zip
Parents
  • 24497
    Suggested Answer
    posted

    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 If
    End Sub

     

Reply Children
No Data