I have a web application where I am doing a Response.Redirect(“Register.aspx”) page in a button_click event.
However, when I am step through this code, when the Response.Redirect(“Register.aspx”) statement executes… the browser becomes the active window & the status bar below says “waiting for response from localhost…” and then after 5 seconds the custom error page is displayed.
How can I debug this to see what is causing the error page to be displayed?
You have several ways to check what’s happening. To begin you can turn off custom errors in web.config, if not already done, and add, if not already present, the global application file Global.asax.
This file defines the Application_Error method, in which you can set a breakpoint to see what happens.
See also: http://msdn.microsoft.com/en-us/library/24395wz3.aspx