English 中文(简体)
MVC 在MVC3中,我似乎转头。
原标题:MVC Error redirect doesn t seem to redirect for me in MVC3

我正在使用MVC 3. 。 我编辑了我的网页。 Config

<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <system.web>
    <compilation xdt:Transform="RemoveAttributes(debug)" />
      <customErrors defaultRedirect="GenericError.htm"
        mode="RemoteOnly" xdt:Transform="Replace">
        <error statusCode="500" redirect="InternalError.htm"/>
      </customErrors>
  </system.web>
</configuration>

现在,当我遇到一段错误时,我仍然看到:

Server Error in  /  Application.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 

完成与我的SOURCE CODE的联系:-

请注意,在我执政时,我已安排“释放”,我用CTRL F5管理。

问题回答

你们是否在当地运作? 请注意,只有远距离用户才会被送至您的习俗错误网页。

mode="RemoteOnly"

在当地也看到这种工作,你可以把价值确定为<代码>。 在上:

mode="On"

So you re Web.Release.Config will look like:

<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <system.web>
    <compilation xdt:Transform="RemoveAttributes(debug)" />
      <customErrors defaultRedirect="GenericError.htm"
        mode="On" xdt:Transform="Replace">
        <error statusCode="500" redirect="InternalError.htm"/>
      </customErrors>
  </system.web>
</configuration>




相关问题
Using jquery to get a partial view and updating the UI

I need to render a partial view (returned from the controller) to show some customer summary details. This will need to happen when the user clicks on a button. In the the mean time the user can ...

MVC 2 / MVC 3 / MVC 4

MVC 2 我们可以轻松地创造领域。 现在,我的问题涉及nes地区(地区内)。

Asp.Net MVC 2 - Changing the PropertyValueRequired string

Using a resx file in the App_GlobalResources directory, I ve been able to change the default message for the PropertyValueInvalid string of the model validators. But it doesn t work to translate the ...

ASP.NET MVC 3 - What features do you want to see? [closed]

I know a bunch of people that are really enjoying the improvements that ASP.NET MVC 2 made over the first release. I have just started to migrate our MVC 1 project over and so far areas has totally ...

热门标签