Reputation: 3746
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?
Upvotes: 1
Views: 3932
Reputation: 25551
Since you said there is a pause, I'm assuming the redirect is working and you're hitting the issue on your Register.aspx page.
Application_Error
method to catch all application errors and log it.Upvotes: 4
Reputation: 2435
u can try Response.Redirect("~/Register.aspx",false);
The second parameter prevent break of current thread.
Upvotes: 0
Reputation: 8166
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
Upvotes: 1
Reputation: 1366
You should have a log somewhere on your computer in the form a text file, which has generated runtime error messages.
Upvotes: 0