Hi,
this is by design because if there is an exception you will not get a
JSON formatted string back to the client (you will get the application
error html code). If you check the result in the callback on the
client-side JavaScript code you will have a property res.error which
includes the exception.
Regards,
Michael
On 9/25/06, Luciano Gmail <[EMAIL PROTECTED]> wrote:
>
> Hi, I'm having problems with global.asax, when a error occurs in a normal
> method (without [AjaxPro.AjaxMethod]) i can catch the error in my
> Application_Error into global.asax, but if the method is
> [AjaxPro.AjaxMethod] e doesn't call Application_Error into global.asax!!!!
> Does anybody know how can i solve this ???
>
> // Works Fine
> protected void Page_Load(object sender, EventArgs e)
> {
> throw (new NullReferenceException());
> }
> void Application_Error(object sender, EventArgs e)
> {
> Exception Ex = Context.Error.GetBaseException();
> string Erro = "URL: " + Ex.TargetSite + " Erro: " + Ex.Message;
> }
>
> // Doesn't Work
> protected void Page_Load(object sender, EventArgs e)
> {
> AjaxPro.Utility.RegisterTypeForAjax(typeof(_Default));
> }
> [AjaxPro.AjaxMethod]
> protected void test(object sender, EventArgs e)
> {
> throw (new NullReferenceException());
> }
> void Application_Error(object sender, EventArgs e)
> {
> Exception Ex = Context.Error.GetBaseException();
> string Erro = "URL: " + Ex.TargetSite + " Erro: " + Ex.Message;
> }
>
> Luciano Sampaio Martins de Souza
> Ciência da Computação - UNIT
>
> >
>
>
>
>
>
>
>
--
Best regards | Schöne Grüße
Michael
Microsoft MVP - Most Valuable Professional
Microsoft MCAD - Certified Application Developer
http://weblogs.asp.net/mschwarz/
http://www.schwarz-interactive.de/
Skype: callto:schwarz-interactive
MSN IM: [EMAIL PROTECTED]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ajax.NET Professional" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/ajaxpro
The latest downloads of Ajax.NET Professional can be found at
http://www.ajaxpro.info/
Don't forget to read my blog at http://weblogs.asp.net/mschwarz/
-~----------~----~----~----~------~----~------~--~---