Enterprise Library and ASP.NET AJAX

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,968
Messages
2,570,152
Members
46,697
Latest member
AugustNabo

Latest Threads

Top