2013-04-27 46 views

Trả lời

29

<customErrors> đi bên <system.web>:

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

Sửa giá trị của các thuộc tính redirect theo tuyến đường của bạn. Bạn cũng có thể triển khai chuyển hướng bắt tất cả bằng cách thêm thuộc tính defaultRedirect vào phần tử customErrors. Xem this MSDN article để biết thêm thông tin.

Các vấn đề liên quan