2013-04-27 31 views

回答

29

<customErrors>走了进去<system.web>:根据您的路线redirect属性

<configuration> 
    <system.web> 
     <customErrors mode="RemoteOnly"> 
      <error statusCode="500" 
        redirect="~/Error/InternalServer" /> 
      <error statusCode="404" 
        redirect="~/Error/NotFound" /> 
     </customErrors> 
    </system.web> 
</configuration> 

修改值。您还可以通过向customErrors元素添加defaultRedirect属性来实现全面重定向。有关更多信息,请参阅this MSDN article

相关问题