Hi all,
Here's my two cents!
In an attempt at answering your first question, "what are the list of properties for 'args.get_error()'?"
args.get_error().name
args.get_error().message
args.get_error().description
args.get_error().httpStatusCode
(For info on the 'Error Object' see: http://msdn.microsoft.com/en-us/library/21x3h1hz.aspx)
"The description and message properties refer to the same message; the description property provides backwards compatibility, while the message property complies with the ECMA standard" - source: http://msdn.microsoft.com/en-us/library/t9zk6eay.aspx
You can also add some client-side JavaScript to the event handler bound to the 'endRequest' event of the 'PageRequestManager', to return the members of 'args.get_error()'. The split() method (mentioned above) is used to 'split' a string into an 'array of strings' and since an object is being returned from the ScriptManager's AsyncPostBackError... that is not going to help us here. Fortunately,
JavaScript offers a special construct, “for in”, that allows
you to easily iterate over all the members of an object without
having to write customised code to accomplish the task:
var errObj = args.get_error();
var members = 'The \'get_error\' members are:\n\n';
for (var i in errObj){
members += '\t' + i + '\n';
}
alert(members);
In an attempt at answering your latter question... you can alter the message displayed to the user either client-side or server-side. I personally found the following two pages very useful. They are well worth a read:
How to improve ASP.NET AJAX error handling
Customizing Error Handling for ASP.NET UpdatePanel Controls
Please note: If you wish to prevent the JavaScript alert alert box for being displayed, you need to let the framework know that the error has been handled. As you'll see mentioned in the pages listed above, this is taken care of with:
args.set_errorHandled(true);
I read somewhere that version 3.5 of the framework does not fire the alert box? I've not tested this though, but just something to maybe lookout for.
I hope this helps someone!
Warm regards,