Windows 2008框上的global.asax重定向失败 [英] global.asax redirect failing on windows 2008 box

查看:125
本文介绍了Windows 2008框上的global.asax重定向失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将站点放在2003服务器上之后,将站点移到了2008上,并进行了一些测试,结果发现对错误的重定向无法转到我拥有的error.aspx页面.我已经搜索了很长时间,没有解决任何办法.

我寻找了一个IIS论坛,但找不到一个.我认为解决方案是在IIS中,但我不确定.

任何帮助将不胜感激.

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.

推荐答案

wolfbinary写道:
wolfbinary wrote:

对错误的重定向无法转到error.aspx页

redirection on an error failed to go to the error.aspx page


因此,您是要从global.asax在错误页上进行重定向吗?您可以向我们展示Application_Error的代码吗?
我想您正在使用Response.Redirect From Application_Error.

这是与IIS 7及其集成模式有关的问题.您正在使用哪种模式? Integrated or Classic ?
如果它的集成模式并更改为经典模式可能有效.


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"/>



如果不使用Application_PreSendRequestHeaderApplication_PreSendRequestContent事件处理程序,请从global.asax中删除它们.

2.调用Context.ClearErrorServer.ClearErrorApplication_Error中使用Response.Redirect()之前清除错误.

希望这对您有帮助:-D



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


这篇关于Windows 2008框上的global.asax重定向失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆