[CLOSED] Ajax Method: intercept errors globally (server-side)

  1. #1

    [CLOSED] Ajax Method: intercept errors globally (server-side)

    Hello,

    I have introduced ELMAH as error logger in my web application.
    By default it cannot trap unhandled exceptions coming from inside an ajax method (DirectMethod, DirectEvent).

    Of course I can trap one exception using try catch:

    try {
      // more code
    } catch(Exception ex) {
       Elmah.ErrorSignal.FromCurrentContext()
            .Raise(ex);
    }
    But, I'd like to Signal all exceptions in all ajax methods. Is there any hook (an event, for example) to do this?
    Thank you
    Last edited by Daniil; Jun 03, 2014 at 2:03 PM. Reason: [CLOSED]
  2. #2
    Hi @sbg,

    I can suggest to try the following.

    Set
    <ext:ResourceManager runat="server" RethrowAjaxExceptions="true" />
    and use Global.asax Application_Error
    protected void Application_Error(object sender, EventArgs e)
    {
        if (X.IsAjaxRequest)
        {
                    
        }
    }

Similar Threads

  1. Server side Method from javascript
    By Roshan in forum 1.x Help
    Replies: 2
    Last Post: Mar 01, 2013, 10:14 AM
  2. Replies: 1
    Last Post: Sep 21, 2011, 11:56 AM
  3. Replies: 3
    Last Post: Mar 07, 2011, 7:17 PM
  4. Server side method to save Gridpanel
    By cpvaishya in forum 1.x Help
    Replies: 0
    Last Post: Jan 27, 2010, 1:09 AM
  5. Invoking Server side method
    By bobs in forum 1.x Help
    Replies: 2
    Last Post: May 08, 2009, 3:12 AM

Tags for this Thread

Posting Permissions