Show friendly message on ASP.NET Ajax error
- by balexandre
You all know how annoying is this:
I do have a log system and the correct error is well explicit there, but I want to give a better message to the user.
I keep trying several ways but I'm using Telerik components and well jQuery and I ended up using both ASP.NET Ajax methods and jQuery, so I use
function pageLoad() {
try {
var manager = Sys.WebForms.PageRequestManager.getInstance();
manager.add_endRequest(endRequest);
manager.add_beginRequest(OnBeginRequest);
manager
}
catch (err) {
alert(err);
}
}
as well
$(document).ready(function() { ... }
that alert(err) is never fired even upon OnClick events
what's the best approach to avoid this message errors and provide a cleaner way?
all this happens in <asp:UpdatePanel> as I use that when I didn't know better (3 years ago!) and I really don't want to mess up and build all again from scratch :(
Any help is greatly appreciated
Updated with more error windows after volpav solution