I haven't tried it - I don't have a web page project handy - but you should be able to edit the
Global.aspx
file and add what code you want to that - there you can pick up the last error object and that should contain the info you need in terms of the exception object:
How to Handle Application_error in ASP.NET App's Global.asax[
^]
The Exception object can contain InnerException details as well as the file, line and stack trace where the error occurred.
Then you can add individual
try...catch
blocks to narrow down the problem as needed.