I was recently surprised to learn about a very subtle, yet important change in asynchronous error handling that Microsoft implemented in ASP.NET AJAX 3.5.
I'd noticed that async errors in a new 3.5 app I'm currently working on no longer resulted in the 2.0-style alert popup - but I just assumed it was some change in IE8RC1 causing the different behavior. It finally bugged me enough that I spent a few minutes researching the topic and ran across a very interesting post on David Barkol's blog explaining the situation.
It seems Microsoft decided to let us handle the error ourselves so we can do whatever we want with it (maybe use a cool jquery modal or something) instead of forcing us to use the vanilla alert box.
David's blog also provides a great code example on how to catch the exception and reinstate the alert box behavior from .NET 2.0.
Tip: For a more descriptive error message, I will sometimes concatenate the usual e.Message text with the InnerException.Message text.
0 comments:
Post a Comment