Page reference in custom IExceptionHandler RRS feed

  • Question

  • User1867197125 posted

    Hi misters,

    I have an application web (asp.net) and I want define custom Handler for exceptionhandling (Enterprise Library)

    My custom class..
        public class GestorExcepcionesIU : IExceptionHandler

    I want to do like this:

    Exception IExceptionHandler.HandleException(Exception exception, Guid handlingInstanceId)
                      RegisterStartupScript(@@@PAGE@@@, "jsExcepcionIU", "alert('Error IU: " + exception.Message.Replace("'", " ") + "');");
                return exception;

    How I get reference of Page in the custom handler ?

    Any help will be appreciated, and I'll be very grateful. Thanks in advance.
    Greetings, regards.


    Tuesday, November 13, 2007 4:14 AM

All replies

  • User-872108916 posted

    I believe you could write directly to the Response stream, rather than using RegisterStartupScript.

    You can use HttpContext.Current.Response.Write(....).

     Hope that helps.

    Friday, November 14, 2008 12:24 PM