G
Guest
Hi misters,
I have an application web ASP.NET 2.0 using ASP.NET AJAX and Ajax Control
Toolkit. Too, we have Enterprise Library (Exception Handling, Logging)
We need handles errors of AJAX,
Any code sample for use Enterprise Library (Exception Handling) and ASP.NET
AJAX ?
void ScriptManager1_AsyncPostBackError(object sender,
AsyncPostBackErrorEventArgs e)
{
string retError = "Ooops...error ocurrido: " +
"\nsender: " +
((System.Web.UI.ScriptManager)(sender)).AsyncPostBackSourceElementID +
"\nException Name: " + e.Exception.GetType().FullName +
"\nMessage: " + e.Exception.Message;
ScriptManager.GetCurrent(this.Page).AsyncPostBackErrorMessage =
retError;
bool rethrow = ExceptionPolicy.HandleException(exception,
TINSA.Servicios.Base.Excepciones.Politicas.PoliticasUtil.NOMBRE_POLITICA_PRESENTACION_WEB);
if (rethrow)
{
//throw exception;
}
}
I define my Policy like this:
Exception IExceptionHandler.HandleException(Exception exception, Guid
handlingInstanceId)
{
HttpContext contexto = HttpContext.Current;
if (contexto != null)
{
Page page = contexto.Handler as Page;
if (page != null)
{
// do something
RegisterStartupScript(page, "jsPoliticaExcepcionIU",
"alert('Error Politica IU: " + exception.Message.Replace("'", " ") + "');");
}
}
return exception;
}
Is it possible register script in my policy and the
AsyncPostBackErrorMessage message not appears (AJAX Client not show the
default alert with the AsyncPostBackErrorMessage value, like I cancel show
that message) ?.
Any help will be appreciated, and I'll be very grateful. Thanks in advance.
Greetings, regards.
I have an application web ASP.NET 2.0 using ASP.NET AJAX and Ajax Control
Toolkit. Too, we have Enterprise Library (Exception Handling, Logging)
We need handles errors of AJAX,
Any code sample for use Enterprise Library (Exception Handling) and ASP.NET
AJAX ?
void ScriptManager1_AsyncPostBackError(object sender,
AsyncPostBackErrorEventArgs e)
{
string retError = "Ooops...error ocurrido: " +
"\nsender: " +
((System.Web.UI.ScriptManager)(sender)).AsyncPostBackSourceElementID +
"\nException Name: " + e.Exception.GetType().FullName +
"\nMessage: " + e.Exception.Message;
ScriptManager.GetCurrent(this.Page).AsyncPostBackErrorMessage =
retError;
bool rethrow = ExceptionPolicy.HandleException(exception,
TINSA.Servicios.Base.Excepciones.Politicas.PoliticasUtil.NOMBRE_POLITICA_PRESENTACION_WEB);
if (rethrow)
{
//throw exception;
}
}
I define my Policy like this:
Exception IExceptionHandler.HandleException(Exception exception, Guid
handlingInstanceId)
{
HttpContext contexto = HttpContext.Current;
if (contexto != null)
{
Page page = contexto.Handler as Page;
if (page != null)
{
// do something
RegisterStartupScript(page, "jsPoliticaExcepcionIU",
"alert('Error Politica IU: " + exception.Message.Replace("'", " ") + "');");
}
}
return exception;
}
Is it possible register script in my policy and the
AsyncPostBackErrorMessage message not appears (AJAX Client not show the
default alert with the AsyncPostBackErrorMessage value, like I cancel show
that message) ?.
Any help will be appreciated, and I'll be very grateful. Thanks in advance.
Greetings, regards.