I know we can capture ScriptManager
errors via EndRequest
event to display as an alert, for example.
Example code to handle error:
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_endRequest(EndRequest);
function EndRequest(sender, args)
{
if (args.get_error())
alert(args.get_error());
}
This error is also displayed on console by default. But, is there a way to actually prevent these errors from appearing on the console? I don't want user to see what the error is, anywhere.
In ASP .Net, you can suppress errors/exceptions from showing up to user on the browser. The errors I am seeing on console when using UpdatePanel are these asp .net errors. Similarly, is it possible that these errors could suppressed from console?