I have a WPF form with a couple of buttons, and for each button I have error handling code:
try {bla bla} catch(Exception e){ more bla }
Add this to you Global.asax:
Global.asax
protected void Application_Error(object sender, EventArgs e) { Exception currentException = Server.GetLastError(); // your handling code goes here ... Server.ClearError(); }