Click here to Skip to main content
15,897,187 members
Please Sign up or sign in to vote.
4.67/5 (2 votes)
I moved a site onto a 2008 box after having it on a 2003 server box and did some testing only to find that the redirection on an error failed to go to the error.aspx page I had. I've been googling this for quite some time to no solution.

I looked for an IIS forum, but couldn't find one. I think the solution is in IIS, but I'm not sure.

Any help would be much appreciated.
Posted
Updated 13-Oct-09 9:47am
v2

1 solution

wolfbinary wrote:
redirection on an error failed to go to the error.aspx page

So, you are redirecting on Error Page from global.asax ? Can you show us the code for Application_Error Secction ?
I guess you are using Response.Redirect From Application_Error.

This is the Problem related with IIS 7 and Its integration mode. Which mode you are using ? Integrated or Classic ?
if Its Integrated mode and change to classic it may work.
Here[^] I found a good solution [ The summary as below ]

Analysis :
The problem is caused by changed behavior of IIS7 new integrated pipeline mode when calling Response.Redirect() in Application_Error. The default .net error page will be rendered before the actual redirection occurs due to error is detected.

Solution

1. Remove the module definition of ScriptModule under system.webServer/modules in web.config. e.g:
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>


Remove Application_PreSendRequestHeader and Application_PreSendRequestContent event handlers from global.asax if they are not used.

2.Call Context.ClearError or Server.ClearError to clear the error before using Response.Redirect() in Application_Error.

Hope this will help you :-D

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900