Sunday, October 12, 2008

Why Response.Redirect does not work in Global.asax.cs:Application_Error()?

My portal uses Application_Error() to redirect to my ErrorPage.aspx. But Response.Redirect() does not work. I debugged to know that this statement was executed but redirect did not happen.

Then I created a sample website to find out that Server.ClearError() is critical. Without this statement, Response.Redirect does nothing. On the other hand, customError section is totally irrelevant.

1 comment:

Allison said...

Thank you, that solved my problem.